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

Problem with using useRouteMatch in storybook #46

Open
Bersam opened this issue Oct 31, 2019 · 1 comment
Open

Problem with using useRouteMatch in storybook #46

Bersam opened this issue Oct 31, 2019 · 1 comment

Comments

@Bersam
Copy link

Bersam commented Oct 31, 2019

Issue:

Which version are you using?

"storybook-react-router": "^1.0.8",

Are you using storybook-router with a react based project or a vue one?

react

Please describe the problem:

It shows the following error when I use useRouteMatch hook:

TypeError: Cannot read property 'match' of undefined
    at useRouteMatch (http://localhost:6007/vendors~main.44791deccf2e14082e5e.bundle.js:138564:78)
.
.
.
    at StoryRouter (http://localhost:6007/vendors~main.44791deccf2e14082e5e.bundle.js:145079:7)

Couldn't get unoptimized version because of this issue on storybook, storybookjs/storybook#8062

Please explain how to reproduce the issue or (better) provide an example to do it.

const CompanyDetailsPage = () => {
  const { path, params } = useRouteMatch();
  const to = pathToRegexp.compile(path)({
    ...params,
    someparameter: 'someparameter',
  }),

  return (<Link to={to} >Link</Link>)
};

should raise mentioned error.

@thareshjose
Copy link

Any updates on this issue?

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

No branches or pull requests

2 participants