Commit 6f08204
authored
fix: Return proper initial styles in PropsFilter for animated style objects (#7385)
## Summary
This PR changes the `PropsFilter` behavior for animated styles.
Before these changes, initial styles of all animated style objects were
merged into a single initial style object. After the first render, the
same initial style object was returned for each animated style, so e.g.
when we had multiple animated styles, the same initial style object was
added to the style array multiple times.
Even though the previous implementation worked on Fabric, I decided to
change it for consistency with implementation in reanimated `3.x.x`. The
new implementation, that returns a correct initial style corresponding
to the animated style object, feels better (in terms of logic) as gives
more expected results (each animated style is given its own initial
style properties, not combined props from all animated styles).
The original PR merged to the `3.17-stable` branch: #73761 parent 6383433 commit 6f08204
File tree
1 file changed
+12
-8
lines changed- packages/react-native-reanimated/src/createAnimatedComponent
1 file changed
+12
-8
lines changedLines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | | - | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
0 commit comments