You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the testing instructions about passing down memoryLocation(...).hook to Router I couldn't find a way to pass down state to the current location. The only args memoryLocation receives are:
path?: Path;
static?: boolean;
record: boolean;
It would be a very useful feature to let an additional prop be passed: state.
The text was updated successfully, but these errors were encountered:
Hi @Grsz, it sounds like a nice feature to have! Adding a label to put it in a backlog, in the meantime feel free to open a pull-request.
I suppose the hook factory function can return a state object, the only caveat that it can't be destructured e.g.:
const{ hook, state, navigate }=memoryLocation(...)// state === {}navigate("/",{state: {foo: "bar"}});// state is still {}, so you have to use this insteadcostlocation=memoryLocation(...)location.state//OK!
I think that it absolutely ok as long as we mention it in the docs.
Following the testing instructions about passing down
memoryLocation(...).hook
toRouter
I couldn't find a way to pass down state to the current location. The only argsmemoryLocation
receives are:It would be a very useful feature to let an additional prop be passed:
state
.The text was updated successfully, but these errors were encountered: