Commit d902158
Fix memory leak in AnimatedProps constructor
Removes __attach() call from AnimatedProps constructor that caused
duplicate child additions when combined with lifecycle hook.
The constructor was calling __attach(), then useLayoutEffect in
useAnimatedProps called it again on the same instance, causing each
AnimatedProps to be added as a child twice to its parent nodes.
This led to unbounded memory growth in applications with frequent
re-renders.
This change aligns with React Native core implementation, which does
not call __attach() in the AnimatedProps constructor1 parent ac73f24 commit d902158
File tree
1 file changed
+0
-1
lines changed- packages/react-native-web/src/vendor/react-native/Animated/nodes
1 file changed
+0
-1
lines changedLines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
0 commit comments