react-native
react-native copied to clipboard
Fix memoization for Animated components when no style is passed in
Summary:
Any component wrapped via createAnimatedComponent() will always re-render, because it creates a new style object. It's impossible to memoize.
Adding useMemo() here ensures that the style object passed to the underlying object is stable: if no style is passed to the wrapped component, then memoization can work.
Allowing memoization to function when the style object is passed in will require a deeper fix. See https://fb.workplace.com/groups/rn.support/permalink/26084643474490921/
Before: {F1496803038}
After: {F1496805410}
Differential Revision: D56618868
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This PR was closed because it has been stalled for 7 days with no activity.