software-mansion / react-native-screens

Native navigation primitives for your React Native app.
MIT License
2.9k stars 496 forks source link

bug(iOS): transitionStart is not triggered for anything but default navigation #2178

Open hirbod opened 3 weeks ago

hirbod commented 3 weeks ago

Description

transitionStart is never reported for presentation modes other than the default. When switching to modal or transparentModal, it only reports transitionEnd. When closing the modal, it reports both transitionStart and transitionEnd.

If the target is pushed normally, it works correctly. This bug occurs only on iOS, not on Android. Open the snack with iOS and check the logs. I have added two buttons, both pushing to the same screen. Only the default one triggers both start and end, while the modal one only emits the end.

Steps to reproduce

Open my Snack and watch the console while testing both buttons.

transitionStart and transitionEnd should work for every presentation mode. Here is a video showcasing everything:

https://github.com/software-mansion/react-native-screens/assets/504909/6f05d06e-89a9-4ace-838a-ee69206d3d09

Snack or a link to a repository

https://snack.expo.dev/@hirbod/react-navigation-transition-event-bug?platform=ios

Screens version

3.21.0

React Native version

0.74.2

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo bare workflow

Architecture

Paper (Old Architecture)

Build type

None

Device

Real device

Device model

All iOS devices

Acknowledgements

Yes

hirbod commented 3 weeks ago

Same issue applies to useTransitionProgress and useReanimatedTransitionProgress by the way.