Commit a9a0000
Prevent double calls to
Summary:
Pull Request resolved: #56424
Changelog: [GENERAL][FIXED] Fixed double `setMounted` flag calls with fabric branching enabled
This change removes the commit source condition from the call site in `ShadowTree::tryCommit` and moves the logic into updateMountedFlag itself:
- Mounted flags are skipped for ReactRevisionMerge commits because they were already set during the React branch commit. Setting them again would double increment the EventEmitter's additive enable counter.
- Runtime shadow node references updates condition didn't change, only moved to a single variable.
- When neither operation is needed, the function returns early to avoid an unnecessary tree traversal under the DispatchMutex.
Reviewed By: lenaic, rubennorte
Differential Revision: D100125886
fbshipit-source-id: aceb1ae3609957048b78f615233ed00ce2e04038setMounted when merging a JS revision (#56424)1 parent 179e0cd commit a9a0000
File tree
2 files changed
+39
-21
lines changed- packages/react-native/ReactCommon/react/renderer/mounting
2 files changed
+39
-21
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| |||
Lines changed: 38 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
32 | 51 | | |
33 | 52 | | |
34 | 53 | | |
| |||
47 | 66 | | |
48 | 67 | | |
49 | 68 | | |
50 | | - | |
51 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
52 | 73 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 74 | + | |
59 | 75 | | |
60 | 76 | | |
61 | 77 | | |
| |||
68 | 84 | | |
69 | 85 | | |
70 | 86 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
79 | 93 | | |
80 | 94 | | |
81 | 95 | | |
82 | 96 | | |
83 | 97 | | |
84 | 98 | | |
85 | 99 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
90 | 108 | | |
91 | 109 | | |
92 | 110 | | |
0 commit comments