grahammendick / navigation

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

Supported native declarative animation api (Web) #801

Closed grahammendick closed 2 months ago

grahammendick commented 2 months ago

Brought the declarative animation api, already implemented on iOS and Android, to the Web. So don't need unmountedStyle, mountedStyle or renderTransition props anymore. The Navigation router translates from the native declarative props to the underlying web 'primitives' on NavigationMotion.

The following Twitter sample declarative animation now runs on Android, iOS and the Web.

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