Skip to content

Commit

Permalink
Update performance.md to reflect existence of useNativeDriver in An…
Browse files Browse the repository at this point in the history
Summary:
…imated API

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes #15215

Differential Revision: D5501206

Pulled By: hramos

fbshipit-source-id: 827494688f405de3e84401460bddf5df17aa497b
  • Loading branch information
abi authored and facebook-github-bot committed Jul 28, 2017
1 parent 292f801 commit 3fadd74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Similarly, you can implement `shouldComponentUpdate` and indicate the exact cond

"Slow Navigator transitions" is the most common manifestation of this, but there are other times this can happen. Using InteractionManager can be a good approach, but if the user experience cost is too high to delay work during an animation, then you might want to consider LayoutAnimation.

The Animated api currently calculates each keyframe on-demand on the JavaScript thread, while LayoutAnimation leverages Core Animation and is unaffected by JS thread and main thread frame drops.
The Animated API currently calculates each keyframe on-demand on the JavaScript thread unless you [set `useNativeDriver: true`](https://facebook.github.io/react-native/blog/2017/02/14/using-native-driver-for-animated.html#how-do-i-use-this-in-my-app), while LayoutAnimation leverages Core Animation and is unaffected by JS thread and main thread frame drops.

One case where I have used this is for animating in a modal (sliding down from top and fading in a translucent overlay) while initializing and perhaps receiving responses for several network requests, rendering the contents of the modal, and updating the view where the modal was opened from. See the Animations guide for more information about how to use LayoutAnimation.

Expand Down

0 comments on commit 3fadd74

Please sign in to comment.