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

No params passed to initial route #316

Closed
ziga-hvalec opened this issue Sep 28, 2023 · 0 comments · Fixed by #330
Closed

No params passed to initial route #316

ziga-hvalec opened this issue Sep 28, 2023 · 0 comments · Fixed by #330

Comments

@ziga-hvalec
Copy link

When using router i'm trying to pass params to the initial route

router is registered

registerSheet(
  'test_router',
  RouterSheet,
);

RouterSheet

  <ActionSheet
    enableRouterBackNavigation
    routes={routes}
    initialRoute={'initial_route'}
  />

Routes

const routes: Route[] = [
  {
    name: 'initial_route',
    component: InitialRouteComponent,
  },
 {
    name: 'second_route',
    component: SecondRouteComponent,
  },
];

i'm trying to navigate like so

SheetManager.show('test_router', {
  params: {
    test: 'test'
  }
}

inside my initial route i'm trying to get the params

const params = useSheetRouteParams();

but this is always undefiend

I did also try navigating to second route and pass params like so

return router?.navigate(
        'second_route',
        {
          test1: 'test1'
        },
      );

which works as expected

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

Successfully merging a pull request may close this issue.

1 participant