Commit acfe2d7
entelostre
Fix TextInput state revisions retaining their predecessor on Android
Summary:
#55719 added shadowViewFromShadowNode() to BaseTextInputShadowNode.h,
nulling props/state on a fragment's parentShadowView so a text-input
state revision does not retain the previous one.
AndroidTextInputShadowNode is `final : public ConcreteViewShadowNode<...>`
and builds its own fragment for the input's text value, so it never
received that fix. ShadowView::state points at the AndroidTextInputState
held when the fragment was built, and that fragment is stored into the
next state by updateStateIfNeeded(), making revision N retain N-1. The
chain grows one link per update and is destroyed by nested recursion,
exhausting the native stack.
Nothing reads Fragment::parentShadowView.props or .state - only tag,
layoutMetrics and componentHandle are consumed - so clearing them is
behaviour-preserving, including on the MapBuffer measurement path.
Changelog:
[Android] [Fixed] - Fix TextInput state revisions retaining their predecessor, causing a native stack overflow after many text updates1 parent b03652a commit acfe2d7
1 file changed
Lines changed: 6 additions & 0 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
193 | 199 | | |
194 | 200 | | |
195 | 201 | | |
| |||
0 commit comments