atlassian-labs / react-resource-router

Configuration driven routing solution for React SPAs that manages route matching, data fetching and progressive rendering
https://atlassian-labs.github.io/react-resource-router
Apache License 2.0
198 stars 28 forks source link

push state #134

Closed liamqma closed 2 years ago

liamqma commented 2 years ago

I've noticed that we can't pass state object when push().

const { push } = useRouterActions();
push(path, state); // state isn't supported

State doesn't get passed in as an argument. https://github.com/atlassian-labs/react-resource-router/blob/master/src/controllers/router-store/index.tsx#L239

That probably means types are incorrect.

I wonder if we should fix the types or support push(path, state). I guess there isn't need to pass state object since query params can be used. Unless, the state is a big nested object. 🙄

I am happy to submit a PR. It should be simple though. Just want to hear your thoughts on which direction we should go about.

liamqma commented 2 years ago

closed this the issue as we are going to support push(path, state).