Use native animations for DefaultTabBar #661
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This combines multiple animated values to have the same resulting value for
scrollValue
as the old code. There were two workarounds needed to make it work, both have PRs on the RN repo that would make it possible to remove them.It is not possible to add listeners to the result of
Animated.add
/Animated.divide
. A lot of code depended on being able to add a listener toscrollValue
, to fix this I monkey patch the listener related methods and compute the value in JS. AnimatedWithChildren support for addListener facebook/react-native#12620There is an issue with Animated.divide where certain values are not promoted to native properly. To fix it I simply call
__makeNative
manually on the values that cause issues. Native Animated - Call x.__makeNative before super.__makeNative facebook/react-native#14435