mochixuan / react-native-smart-tip

🔥🔥🔥Toast , SnackBar , Modal , Show Toast above Modal
247 stars 37 forks source link

useNativeDriver #6

Closed taoqf closed 5 years ago

taoqf commented 5 years ago

Without this flag, it runs really slow on android.

mochixuan commented 5 years ago

useNativeDriver allows the animation to be rendered natively, reducing the generation of virtual doms and the comparison of diff algorithms, but will cause the js side to lose control of the animation, but it can be added here. useNativeDriver is a very nice optimized pair of animations.

In the rescue-native debug mode, the animation will be slower, but not in the release. There is a cancel function inside. If the animation is executed halfway and the animation is canceled, js can have absolute right to speak on this drawing process.

taoqf commented 5 years ago

Learned. Do you mean we don't need useNativeDriver? Then why don't we add it since we don't need to cancel the animation?

mochixuan commented 5 years ago

In normal development, useNativeDriver is generally added, which can reduce the virtual DOM generation and Diff comparison on the React side during the animation process. The animation process is all given to the original, and the RN gives up management rights.

taoqf commented 5 years ago

Um, do you mean you won't merge this pr?