react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Fix memoization for Animated components when no style is passed in

Open RandomEngy opened this issue 1 year ago • 1 comments

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

RandomEngy avatar Apr 26 '24 05:04 RandomEngy

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.

react-native-bot avatar Oct 23 '24 05:10 react-native-bot

This PR was closed because it has been stalled for 7 days with no activity.

react-native-bot avatar Oct 31 '24 05:10 react-native-bot