Skip to content
New issue

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

Deep-links params are nested in two levels of params #9006

Closed
marcinkornek opened this issue Oct 30, 2020 · 3 comments
Closed

Deep-links params are nested in two levels of params #9006

marcinkornek opened this issue Oct 30, 2020 · 3 comments

Comments

@marcinkornek
Copy link

Current Behavior

Deep-links params are nested in two levels of params

Here is my linking config:

const linking = {
  prefixes: ['https://www.myapp.com', 'myapp:'],
  config: {
    screens: {
      MagicLinkLogin: {
        path: 'magic-login/:token',
      },
    },
  },
}

in screen MagicLinkLogin token should be available under route.params.token but it's not. It's under route.params.params.token

Here's how my routes look like:

// RootStack.js
[...]
const RootNavigator = () => {
 return (
   <NavigationContainer
      linking={deepLinksConfig.linking}
    >
      <RootStack.Navigator>
        <RootStack.Screen
          name="Auth"
          component={AuthStack}
          options={{
            headerShown: false,
          }}
        />
      </RootStack.Navigator>
    </NavigationContainer>
)

export default RootNavigator
// AuthStack.js

const AuthStack = () => {
  return (
    <Stack.Navigator>
      [...]
      <Stack.Screen
        name="MagicLinkLogin"
        component={MagicLinkLoginScreen}
      />
    </Stack.Navigator>
  )
}

Expected Behavior

Params from deep link should be available in route.parms, not in route.params.params

Your Environment

software version
iOS or Android iOS 14.1 simulator
@react-navigation/native 5.8.1
react-native 0.63.3
node v13.8.0
yarn 1.22.0
@github-actions
Copy link

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible.

The easiest way to provide a repro is on snack.expo.io. If it's not possible to repro it on snack.expo.io, then please provide the repro in a GitHub repository.

@lucksp
Copy link

lucksp commented Apr 6, 2023

hi @marcinkornek did you happen to resolve this params.params issue? I am running into it also

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants