fram-x / FluidTransitions

Fluid Transitions for React Navigation
MIT License
2.93k stars 194 forks source link

Unsure how to set transitionConfig for named transitions #171

Open sebringj opened 5 years ago

sebringj commented 5 years ago

Is it possible to provide an example using the already created animations for appear such as "left", "right" etc transition names?

Currently I am using the less capable library of react-navigation-transitions like so:

const handleCustomTransition = ({ scenes }) => {
  const nextScene = scenes[scenes.length - 1].route.routeName

  if (FromBottom[nextScene])
    return fromBottom()
  else if (FromLeft[nextScene])
    return fromLeft()
  else if (FromTop[nextScene])
    return fromTop()

  return
}

but would like to do with your library

const handleCustomTransition = ({ scenes }) => {
  const nextScene = scenes[scenes.length - 1].route.routeName

  if (FromBottom[nextScene])
    return 'bottom'
  else if (FromLeft[nextScene])
    return 'left'
  else if (FromTop[nextScene])
    return 'top'

  return
}

thanks