Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change default value of context of ScreenGestureDetector, add wa…
…rning for goBackGesture (software-mansion#2013) ## Description Previously, after going from one screen to another (or after opening the app) there was an error regarding ScreenGestureDetector: `Warning: Invalid prop 'gestureDetectorBridge' supplied to 'React.Fragment'. React.Fragment can only have 'key' and 'children' props.` This error indicates that we were passing props from ScreenGestureDetector to React.Fragment. Indeed, after looking onto the default value of GHContext, there was a Fragment that was receiving invalid props. This PR fixes this by changing the look of React.Fragment, so we won't pass the props further. Also, I've added a warning that is being shown when user tries to use `goBackGesture` and the navigator is not wrapped in ScreenGestureDetector. Fixes software-mansion#2010. ## Changes - Fix warning of React.Fragment when the ScreenGestureDetector isn't mounted - Add warning when user tries to use `goBackGesture` and the navigator is not wrapped in ScreenGestureDetector - Reformated code a bit ## Screenshots / GIFs ### Before https://github.com/software-mansion/react-native-screens/assets/23281839/f3517b73-de80-45a5-847e-bd817d3d2682 ### After Video shows behavior on going from one screen to another and a warning when there's prop `goBackGesture` without ScreenGestureProvider. https://github.com/software-mansion/react-native-screens/assets/23281839/7b477ea6-08cc-40ed-afd5-879675776007 ## Test code and steps to reproduce You can test the changes in a several ways: - By checking Screen animation example from ScreensExample - By checking Test42 from TestsExample - By checking TestScreenAnimation from FabricTestExample ## Checklist - [X] Included code example that can be used to test this change - [x] Ensured that CI passes
- Loading branch information