We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.0.0
use withRouter without a Router ;) (Rendering stuff in styleguidist) this.props.router is used only in action handlers
withRouter
this.props.router
The component should at least render.
Get an error message:
TypeError: Cannot read property 'params' of undefined
Unfortunately, I am unable to debug in styleguidist quickly, but I think the error is coming from here: https://github.com/ReactTraining/react-router/blob/6eeb7ad358f987520f5b519e48bdd31f725cbade/modules/withRouter.js#L32
Maybe a quick and dirty fix on Line 31 would be enough:
const router = this.props.router || this.context.router || {}
The text was updated successfully, but these errors were encountered:
We should probably just return the wrapped component:
if (!router) return <WrappedComponent {...this.props} />
A PR for this would be appreciated!
Sorry, something went wrong.
bc66a96
No branches or pull requests
Version
3.0.0
Steps to reproduce
use
withRouter
without a Router ;) (Rendering stuff in styleguidist)this.props.router
is used only in action handlersExpected Behavior
The component should at least render.
Actual Behavior
Get an error message:
TypeError: Cannot read property 'params' of undefined
Unfortunately, I am unable to debug in styleguidist quickly, but I think the error is coming from here:
https://github.com/ReactTraining/react-router/blob/6eeb7ad358f987520f5b519e48bdd31f725cbade/modules/withRouter.js#L32
Maybe a quick and dirty fix on Line 31 would be enough:
const router = this.props.router || this.context.router || {}
The text was updated successfully, but these errors were encountered: