IjzerenHein / react-navigation-shared-element

React Navigation bindings for react-native-shared-element 💫
https://github.com/IjzerenHein/react-native-shared-element
MIT License
1.27k stars 124 forks source link

Stack Navigator from createSharedElementStackNavigator gives type error #209

Closed kemusa closed 2 years ago

kemusa commented 2 years ago

I've implemented the following code:

Screen Shot 2021-10-15 at 1 18 41 AM

and get this error: Type '{ children: Element[]; headerMode: string; initialRouteName: string; }' is not assignable to type 'IntrinsicAttributes & ((Pick<DefaultRouterOptions<string> & { children: ReactNode; screenOptions?: StackNavigationOptions | ((props: { ...; }) => StackNavigationOptions) | undefined; } & StackNavigationConfig, "children" | ... 2 more ... | "keyboardHandlingEnabled"> & { ...; }) | PropsWithChildren<...>)'. Type '{ children: Element[]; headerMode: string; initialRouteName: string; }' is missing the following properties from type 'Pick<DefaultRouterOptions<string> & { children: ReactNode; screenOptions?: StackNavigationOptions | ((props: { route: RouteProp<Record<string, object | undefined>, string>; navigation: any; }) => StackNavigationOptions) | undefined; } & StackNavigationConfig, "children" | ... 2 more ... | "keyboardHandlingEnabled">': mode, keyboardHandlingEnabled

I'm using: Expo: ~42.0.1 React Navigation Shared Element: ^5.0.0-alpha1 React Native Shared Element: 0.7.0 React Navigation: v6

kemusa commented 2 years ago

Turns out the version of React Native Shared Element was the issue. For some reason npm doesn't automatically install the latest. I fixed it by manually upgrading to version 3.1.3