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
location.state
react-router 4.2.0
https://codepen.io/anon/pen/vjXabp?editors=0011
const loc = { pathname: "path", state: { some: "state", }, } const context = {} const PrintState = ReactRouter.withRouter( ({location}) => `${location.pathname}: ${JSON.stringify(location.state)}`) const out = ReactDOMServer.renderToString( <ReactRouter.StaticRouter location={loc} context={context}> <PrintState /> </ReactRouter.StaticRouter> ); console.log(out)
passing a complete location object to StaticRouter, as described here: https://reacttraining.com/react-router/web/api/StaticRouter/location-object
location
anywhere I use location, for example when using withRouter, the state should be there
withRouter
state
state is undefined.
undefined
The text was updated successfully, but these errors were encountered:
This is already fixed with #5722: https://codepen.io/timdorr/pen/depQmv?editors=0011
Sorry, something went wrong.
No branches or pull requests
Version
react-router 4.2.0
Test Case
https://codepen.io/anon/pen/vjXabp?editors=0011
Steps to reproduce
passing a complete
location
object to StaticRouter, as described here: https://reacttraining.com/react-router/web/api/StaticRouter/location-objectExpected Behavior
anywhere I use
location
, for example when usingwithRouter
, thestate
should be thereActual Behavior
state
isundefined
.The text was updated successfully, but these errors were encountered: