Commit 9052f0b
Summary:
Pull Request resolved: #57339
Every Props subclass parses its fields in its 3-arg ctor's initializer list, but `Props` was the odd one out — its 3-arg ctor had an empty initializer list and a body that called a separate `Props::initialize` method, which then assigned `nativeId` and (on Android) ran `initializeDynamicProps`.
Fold the `nativeId` parse back into the initializer list and inline the Android `initializeDynamicProps` call into the ctor body, matching the subclass pattern.
This removes the only remaining external caller of `Props::initialize`: `YogaStylableProps`'s ctor was constructing its `Props` subobject via `Props()` and then calling `initialize(...)` from its body. Replace with the standard `Props(ctx, sourceProps, rawProps, filterObjectKeys)` initializer-list chain. With both call sites gone, delete `Props::initialize` outright.
Behaviour is unchanged: the work that `initialize` did still runs on the same construction path, just via the ctor itself.
Changelog:
[Internal]
Reviewed By: christophpurrer
Differential Revision: D109691981
fbshipit-source-id: 835615191332239e90353da2e66fecc429365529
1 parent e73592b commit 9052f0b
12 files changed
Lines changed: 15 additions & 41 deletions
File tree
- packages/react-native/ReactCommon/react/renderer
- components/view
- core
- scripts/cxx-api/api-snapshots
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
Lines changed: 10 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 19 | | |
28 | 20 | | |
29 | 21 | | |
30 | 22 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
| |||
Lines changed: 0 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 85 | | |
98 | 86 | | |
99 | 87 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4125 | 4125 | | |
4126 | 4126 | | |
4127 | 4127 | | |
4128 | | - | |
4129 | 4128 | | |
4130 | 4129 | | |
4131 | 4130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3979 | 3979 | | |
3980 | 3980 | | |
3981 | 3981 | | |
3982 | | - | |
3983 | 3982 | | |
3984 | 3983 | | |
3985 | 3984 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4122 | 4122 | | |
4123 | 4123 | | |
4124 | 4124 | | |
4125 | | - | |
4126 | 4125 | | |
4127 | 4126 | | |
4128 | 4127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6312 | 6312 | | |
6313 | 6313 | | |
6314 | 6314 | | |
6315 | | - | |
6316 | 6315 | | |
6317 | 6316 | | |
6318 | 6317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6194 | 6194 | | |
6195 | 6195 | | |
6196 | 6196 | | |
6197 | | - | |
6198 | 6197 | | |
6199 | 6198 | | |
6200 | 6199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6309 | 6309 | | |
6310 | 6310 | | |
6311 | 6311 | | |
6312 | | - | |
6313 | 6312 | | |
6314 | 6313 | | |
6315 | 6314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2730 | 2730 | | |
2731 | 2731 | | |
2732 | 2732 | | |
2733 | | - | |
2734 | 2733 | | |
2735 | 2734 | | |
2736 | 2735 | | |
| |||
0 commit comments