Commit f88a214
committed
fix(android): always accumulate rawProps so un-flatten CREATE carries full props
Drop the earlier BackgroundStyleApplicator workaround — it targeted the
wrong layer. Fix the actual root cause in Props::initializeDynamicProps.
When a View with borderRadius + transparent backgroundColor mounts, Fabric
flattens it and no Android View is created. On a later JS update such as
backgroundColor -> opaque, the Differentiator sees the node un-flatten and
emits a CREATE mutation for a brand-new native View. FabricMountingManager
ships the props for that CREATE as newProps->rawProps.
The problem: under the default (non-accumulated) path, Props::initialize
overwrote rawProps with rawProps.toDynamic(filterObjectKeys) on every
clone — storing only the latest JS diff, not the full accumulated state.
So at un-flatten time, rawProps for the newly-concrete shadow node held
only {backgroundColor: <color>} and the Android View received only that
prop. borderRadius, borderWidth, etc. were never delivered, so the view
rendered without them.
The fix merges the previous rawProps with the incoming patch on every
clone, so rawProps always reflects the full accumulated prop set. The
existing getProps logic then ships the complete set on CREATE and the
newly-created View gets every prop it should have.
This was previously gated behind enableAccumulatedUpdatesInRawPropsAndroid.
Always running it costs an extra folly::dynamic merge per clone but fixes
a real correctness bug that could affect any view-flattening-prone
component with more than one style prop.1 parent a5bfcd6 commit f88a214
2 files changed
Lines changed: 14 additions & 14 deletions
File tree
- packages/react-native
- ReactAndroid/src/main/java/com/facebook/react/uimanager
- ReactCommon/react/renderer/core
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
| 640 | + | |
645 | 641 | | |
646 | 642 | | |
647 | 643 | | |
| |||
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
0 commit comments