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
Error: Invariant failed: You should not use <Link> outside a <Router> #8892
Comments
for the meantime, this lib https://github.com/gvaldambrini/storybook-router mitigated the error |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
I'm getting this too. Just bumping the comment thread to not let this go stale. |
This is not an issue with storybook, the error comes from
Storybook can't be expected to pull in and wrap third party library's wrappers. For example similar errors would occur with components that use |
Same error for me. @afholderman solution worked perfectly. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Thanks @afholderman Also we can simply use
|
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
@nickzcv and for those of you using CSF: import { MemoryRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import { store } from '../../../../redux/store/connect';
export default {
title: 'common',
decorators: [
getStory => <Provider store={store}>{getStory()}</Provider>,
getStory => <MemoryRouter>{getStory()}</MemoryRouter>,
]
}
export const ComponentName = () => <Component />; |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
I'm using styled components and get this error by creating an styled link, although if I create the styled componentn inside the index.js I get no error, why? |
Describe the bug
It throws an error when trying to view a components with react-router(s). However, components works fine with the normal react-scripts start
To Reproduce
Steps to reproduce the behavior:
view any components with react-router-dom
Expected behavior
no errors
Code snippets
If applicable, add code samples to help explain your problem.
Screenshots
System:
System:
OS: macOS 10.15.1
CPU: (4) x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
Binaries:
Node: 10.16.2 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Browsers:
Chrome: 78.0.3904.97
Safari: 13.0.3
npmPackages:
@storybook/addon-actions: ^5.2.4 => 5.2.4
@storybook/addon-links: ^5.2.4 => 5.2.4
@storybook/addons: ^5.2.4 => 5.2.4
@storybook/react: ^5.2.4 => 5.2.4
The text was updated successfully, but these errors were encountered: