If animation run on JS Thread then for each frame the JS Thread will send serialized data on Bridge to the UI Thread. This will result in something similar with real life traffic jam where we have the bridge and the cars(code for each frame).
In addition of this imagine also doing a network request and a dispatch for global state, the JS Thread would be more busy resulting in even more lag.
A very good solution for running animations on UI Thread is react-native-reanimated which also give the opportunity to run any piece of JS code, not only animations.
7
17 reads
CURATED FROM
IDEAS CURATED BY
TL;DR how threading is working in React Native and the solution of handling data flux for a like button and its counter
“
Read & Learn
20x Faster
without
deepstash
with
deepstash
with
deepstash
Personalized microlearning
—
100+ Learning Journeys
—
Access to 200,000+ ideas
—
Access to the mobile app
—
Unlimited idea saving
—
—
Unlimited history
—
—
Unlimited listening to ideas
—
—
Downloading & offline access
—
—
Supercharge your mind with one idea per day
Enter your email and spend 1 minute every day to learn something new.
I agree to receive email updates