Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Android): Set stateWrapper in ScreenViewManager in Fabric (softwa…
…re-mansion#1944) ## Description We are in the process of migrating to New Architecture. We noticed a suspicious error message in LogCat, and discovered that `FabricEnabledViewGroup`'s state updates in `updateScreenSizeFabric()` would fail with "setState called without a StateWrapper", due to: https://github.com/facebook/react-native/blob/79d620dff7561e6c9370184f9f19e79643486716/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java#L65 ## Changes Call `fabricViewStateManager.setStateWrapper()` in `ScreenViewManager.kt`. <img width="1285" alt="Screen Shot 2023-10-23 at 11 20 09 AM" src="https://github.com/software-mansion/react-native-screens/assets/12057449/3411e42d-fba3-4b11-b601-66cfb557cc62"> <img width="1808" alt="Screen Shot 2023-10-23 at 11 32 28 AM" src="https://github.com/software-mansion/react-native-screens/assets/12057449/28d1f518-da4a-4971-bfb2-5c2c5b7458e0"> ## Test code and steps to reproduce Run `FabricExample` and `Example`. View LogCat logs. ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Updated documentation: <!-- For adding new props to native-stack --> - [ ] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes --------- Co-authored-by: Tymoteusz Boba <[email protected]>
- Loading branch information