grahammendick / navigation

Scene-Based Navigation for React and React Native
https://grahammendick.github.io/navigation/
Apache License 2.0
571 stars 40 forks source link

Supported declarative animation api (iOS) #778

Closed grahammendick closed 4 months ago

grahammendick commented 4 months ago

Supported the declarative animation api using the native iOS primitives for customising the transition animations. For example, the following transition from the Twitter sample works on iOS as well as Android. To avoid breaking changes, the transition only runs on iOS when the customAnimation prop of the NavigationStack is set to true.

<NavigationStack
  customAnimation
  crumbStyle={[
    {type: 'alpha', start: 0},
    {type: 'scale', startX: 0.8, startY: '0.8'},
    {type: 'translate', startX: '5%'},
  ]}
  unmountStyle={{type: 'translate', startX: '100%'}}
>

Setting the hidden prop on the NavigationBar doesn't block the swipe back anymore. Don't consider this a breaking change because that isn't documented behaviour