We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi everyone,
I have an issue with react-navigation v6.
Usually I take advantage of the id prop of the navigator to retrieve a not direct parent navigator using the useNavigation hook like this :
id
useNavigation
type ExploreScreenProps = StackScreenProps< ExploreStackParamList, 'ExploreScreen', NavigatorName >; type AppNavigationProp = StackNavigationProp<RootStackParamList>; const ExploreScreen = ({ navigation }: ExploreScreenProps) => { const parentNavigation = navigation.getParent<AppNavigationProp>( NavigatorName.APP_NAVIGATOR, ); // This should return the navigation object but it returns undefined console.log('Parent Navigation :', parentNavigation); }
But When I use createSharedElementStackNavigator, The id prop is not accepted. and I have this error :
createSharedElementStackNavigator
My code :
const AppNavigatorShared = createSharedElementStackNavigator<ContentStackParamList>(); const AppScreen = () => ( <AppNavigatorShared.Navigator id={NavigatorName.APP_NAVIGATOR} // initialRouteName={ScreenName.HOME_SCREEN}
The error :
Type '{ children: Element[]; id: NavigatorName; initialRouteName: ScreenName.HOME_SCREEN; screenOptions: { headerTitleAlign: "center"; headerShadowVisible: false; headerStyle: { ...; }; headerTintColor: string; }; }' is not assignable to type 'IntrinsicAttributes & ((Omit<((Omit<DefaultRouterOptions<string> & { children: ReactNode; screenListeners?: Partial<{ ...; }> | ((props: { ...; }) => Partial<...>) | undefined; screenOptions?: StackNavigationOptions | ... 1 more ... | undefined; defaultScreenOptions?: StackNavigationOptions | ... 1 more ... | undefi...'. Property 'id' does not exist on type 'IntrinsicAttributes & ((Omit<((Omit<DefaultRouterOptions<string> & { children: ReactNode; screenListeners?: Partial<{ ...; }> | ((props: { ...; }) => Partial<...>) | undefined; screenOptions?: StackNavigationOptions | ... 1 more ... | undefined; defaultScreenOptions?: StackNavigationOptions | ... 1 more ... | undefi...'.
I tried to pass a name prop in the createSharedElementStackNavigator like this, according to that line
name
react-navigation-shared-element/src/createSharedElementStackNavigator.tsx
Lines 56 to 58 in 1ce95a2
const AppNavigatorShared = createSharedElementStackNavigator<ContentStackParamList>({ name: NavigatorName.APP_NAVIGATOR, debug: true, });
but it did not change anything.
Someone has an idea ? Thanks !
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi everyone,
I have an issue with react-navigation v6.
Usually I take advantage of the
id
prop of the navigator to retrieve a not direct parent navigator using theuseNavigation
hook like this :But When I use
createSharedElementStackNavigator
, Theid
prop is not accepted. and I have this error :My code :
The error :
I tried to pass a
name
prop in thecreateSharedElementStackNavigator
like this, according to that linereact-navigation-shared-element/src/createSharedElementStackNavigator.tsx
Lines 56 to 58 in 1ce95a2
but it did not change anything.
Someone has an idea ? Thanks !
The text was updated successfully, but these errors were encountered: