Replies: 3 comments 7 replies
-
Can you check to see how often this parent view is being re-rendered? What state is it observing, if any, via |
Beta Was this translation helpful? Give feedback.
-
Hey @AAAstorga, Stephen is away right now, but I think I'm seeing the problem with the code you posted. In self.viewStore = ViewStore(store) However, if you look at the body of the view you see that there are only two pieces of data you actually need from the view store: if !viewStore.recentSongs.isEmpty
...
if viewStore.recentSongs.count > 3 This means you are re-computing this view any time a single piece of data changes in the In fact, I see you are already doing that for |
Beta Was this translation helpful? Give feedback.
-
Just to close out this thread -- I fixed the problem. I was not scoping State that well in my ViewStores and that caused so much unnecessary rendering. After fixing it, my scrolling is now buttery smooth. Thank you so much for all the help! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am working on a music app and have I have a search page. The user can search for songs and get a list of songs back. Each song row has play functionality so you can listen to the preview. When playing a preview, scrolling becomes insanely laggy (even when there are only 20 items). I am not sure why this is happening and was hoping to get some ideas.
PreviewPlayerClient
which is used in Environment.Sorry for all the code, but I am trying to have you get a complete picture. When no song is playing, the scroll perf is great. When a song is playing the PreviewPlayerClient emits an Action every 0.2 seconds with the new progress and that action seems to be lagging the view. I added some logging and each SearchSongView (as seen in 4) is recomputing when the progress updates even though really only one should be updating? How do I stop having the ForEachView recompute every single child?
Thank you all so much for any tips!
Beta Was this translation helpful? Give feedback.
All reactions