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

Added state to .push #215

Closed AlexanderKaran closed 1 year ago

atlassian-cla-bot[bot] commented 1 year ago

Hooray! All contributors have signed the CLA.

albertogasparin commented 1 year ago

Great start! Would you mind:

Thanks!!

AlexanderKaran commented 1 year ago

@albertogasparin Added state to replace, pushTo and replaceTo. I also added state to the Link and changed it so we are not copying state and just using it from location. Due to the state being in location, I am not sure the extra setup and changes to the useRouter are needed as the four other functions get tested for a return in state and location is in useRouter

albertogasparin commented 1 year ago

Looks great! I have one last ask: can you mention it in the docs? So it's clear that those APIs and Link accept state and you can find the value inside location

AlexanderKaran commented 1 year ago

@albertogasparin Added an example and updated Link props, let me know if you need more