-
-
Notifications
You must be signed in to change notification settings - Fork 634
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
Passing state with a Router link no longer works with inferno-router 8.0.3
#1608
Comments
Hi, Thanks for reporting the issue. Where are you expecting this state to be passed? How was it working previously and what version you were using previously? |
It used to work on <NavLink
to={{
pathname: "/create_post",
anyStateHere: XXX,
}}
/>
...
// Access it like this in the other component:
let anyStateHere = this.props.location.state.anyStateHere; |
Ok thx, I will check |
|
According to the docs of the package So what happened is that we bumped the history package from v4 to v5 and lost the fallback from v4 where state and location could be passed in a single object:
So we need to unpack the object in Link.ts and change our invocation of history.replace and history.push. Here is a reference to a react-router commit that I believe addresses the same issue. The commit also contains tests. |
I also couldn't find any unit tests for state.
Example:
State ends up as
null
The text was updated successfully, but these errors were encountered: