Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native android transitions are really slow

My react native transitions (using the Navigator) are really slow, dropping the javascript thread frames to 0 for a second or two when the animation first starts, then picking up to ~20, then pausing halfway through, and then usually finishing relatively smoothly. I'm testing on a clean Galaxy Note 4, so it's not an emulator issue.

I'm rendering empty views with InteractionManager.runAfterInteractions and then a 5-element listview after the animation is complete. I've compiled the app for production and turned dev mode off.

Is this expected/the current state of things (hopefully to improve), or am I probably doing something wrong? If so, what's the best way to hunt that down? I have very little logic running.

If there isn't an easy solution, is there a way to disable animations on Navigator transitions?

like image 475
Eason Goodale Avatar asked Nov 21 '15 07:11

Eason Goodale


People also ask

Why is React Native so slow on Android?

Slow app launch is another issue of React Native apps. If your app opens too slowly, you probably have too many dependencies in your app and you're using slow components. Try to use fast, high-performance components and decrease the number of dependencies in your app. For example, the Object.

Why React Native is so slow?

You will want to make sure that you turn off "JS Dev Mode," or else it will run painfully slow on device. This is how you disable JS Dev Mode on Android: After running "react-native run-android" you should "shake" your device to bring up the menu. Select "Dev Settings" then uncheck "JS Dev Mode."

Is React Native declining?

Part reason for the decline in React Native's popularity is due to the emergence of Google-backed Flutter that slowly but gradually started gaining wider acceptance among developers and clients alike.


1 Answers

Turn off chrome debugger, it makes animation really slow.

like image 98
Idan Gozlan Avatar answered Oct 20 '22 01:10

Idan Gozlan