react-native-screens
react-native-screens copied to clipboard
feat: configuring native-stack transitions from JS
Description
Added an option to provide custom transitions between screens from JS. It requires setting stackAnimation: 'custom'
and providing animationSpec
on screen.
Changes
Added stackAnimation: 'custom'
and animationSpec
prop to Screen
component.
Test code and steps to reproduce
Test1035.tsx
Checklist
- [x] Included code example that can be used to test this change
- [x] Updated TS types
- [ ] Updated documentation:
- [ ] https://github.com/software-mansion/react-native-screens/blob/master/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [ ] https://github.com/software-mansion/react-native-screens/blob/master/native-stack/README.md
- [ ] https://github.com/software-mansion/react-native-screens/blob/master/createNativeStackNavigator/README.md
- [ ] https://github.com/software-mansion/react-native-screens/blob/master/src/types.tsx
- [ ] https://github.com/software-mansion/react-native-screens/blob/master/src/native-stack/types.tsx
- [x] Ensured that CI passes
This would be a great feature to land!
Agree this would be awesome - curious, was this PR mostly an experiment to gauge feasibility?
I think we will not go this way with custom transitions. After we release SET(https://github.com/software-mansion/react-native-screens/pull/1591), I think we can extend the API to be able to animate whole screens with it so we'll get the benefit of all preconfigured animations etc.