-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
The context router undefined #4645
Comments
Are you just changed |
Was trying to downgrade to
|
@expdevelop That's because |
Solved! Delete "react-router": "4.0.0-beta.6",
"react-router-dom": "4.0.0-beta.6", then |
I have same issue when i run test and use enzyme (mount) also with =>
|
Yes, this is because "react-router-dom"'s package.json has a dependency for "react-router": "^4.0.0-beta.6" for which it pulls in "4.0.0-beta.7" version. What you need to do is this: After that it should work (fixed for me). |
Tried the steps of @vyushenko. Still get the same error "Failed context type: The context |
@natashache see @mjackson's comment in #4759 |
I get this error when trying to map map(([key, idea]) => (
<Link
key={key}
to={`/idea/${key}`}
>
<Idea
votes={idea.votes}
title={idea.title}
/>
</Link>
)) I'm using EDIT: Answered my own question. I was testing without a |
Your class also needs @expdevelop contextTypes: {
router: PropTypes.object
}, Before use it, you should be install prop-types package for use this in React v15.5.x, |
This can happen if you do not wrap <Link /> with a <BrowserRouter /> at a parent level. |
Spent all day trying to figure this out for project 1 of Udacity's React nanodegree. BrowserRouter was the answer. Forgot it needed to be included in index.js. Thanks @scifutures Phrases for searchability: |
Hey guys, I need your help!
Everything was good until the moment when I decided to remove
node_modules
folder and redownload it bynpm install
.So, now I got the error in every component where I used context
router
, for exampleCatalogFilterContainer
->:In
CatalogFilterContainer
->Project is here - https://github.com/expdevelop/ultrastore
First of all install dependencies by
npm install
and runnpm run dev
. Then go to (for example)localhost:5000/catalog/phones
.Router version ->
The text was updated successfully, but these errors were encountered: