Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6208

React Typescript Error using static object

$
0
0

I am building a react native app and am using react-native-reanimated and react-navigation-animated-switch to try and create an animation when changing screens. I am also using typescript. Just following react-navigation's guide I can't figure out why there example doesn't work for me. https://reactnavigation.org/docs/en/animated-switch-navigator.html

import createAnimatedSwitchNavigator from 'react-navigation-animated-switch';
import { Transition } from 'react-native-reanimated';

const MySwitch = createAnimatedSwitchNavigator(
 {
Home: HomeScreen,
Other: OtherScreen,
},
{
transition: (
  <Transition.Together>
    <Transition.Out
      type="slide-bottom"
      durationMs={400}
      interpolation="easeIn"
    />
    <Transition.In type="fade" durationMs={500} />
  </Transition.Together>
),

} );

All the code that uses Transition I get a typescript error that Transition refers only to a type. Transition has a static objects Together, In etc but it is not found. Also it the package does have ts.d file.

Thanks


Viewing all articles
Browse latest Browse all 6208

Trending Articles