Reputation: 1904
I have an app that in several places has the following pattern:
The problem is that I suspect that this is bad for performance. At any given time the app is either rendering both a spinner while making api calls or the app is rendering a spinner while having a navigation animation to the next scene. I'm noticing substantial frame-rate decline during these kinds of transitions.
React-Native's performance documentation suggests using LayoutAnimation
instead of Animation
to improve performance. However, the documentation is lacking and I cant figure out how to get LayoutAnimation
to rotate things. I could also stop rendering the spinner during the scene transitions, but I find that this makes things look weird and only solves half the problem.
I can't be the first person with this problem. (1) How has it been solved before? (and/or 2) How can I get LayoutAnimation
to rotate the spinner?
Upvotes: 1
Views: 267
Reputation: 6039
Try setting useNativeDriver
to true
in your animation. LayoutAnimation
doesn't currently support rotation but there may be plans for it
Upvotes: 1