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
202 stars 28 forks source link

Allow router store push/replace to take a LocationShape #171

Closed yamadapc closed 1 year ago

yamadapc commented 2 years ago

Currently router store push/replace requires a string in the types, but they will work with location objects. This commit modifies their types as well as one history implementation to accept a location object.

jackbrown commented 2 years ago

@yamadapc could you also update the docs for these actions? https://github.com/atlassian-labs/react-resource-router/blob/master/docs/api/components.md#routeractions

liamqma commented 2 years ago

Should we update other types too? For example, PublicRouterActions https://github.com/atlassian-labs/react-resource-router/blob/master/src/controllers/router-store/types.ts#L107

yamadapc commented 2 years ago

Should we update other types too?

Didn't I update them?

liamqma commented 2 years ago

ohh, sorry, I missed it. Can you update the Flow type too? https://github.com/atlassian-labs/react-resource-router/blob/master/src/types.js.flow#L218

albertogasparin commented 2 years ago

Thanks Pedro. Can you rebase and add one test for push and one for replace? https://github.com/yamadapc/react-resource-router/blob/6e2a723dc8be31c3de7200563ed031e72ab9ba54/src/__tests__/unit/common/utils/history/test.ts#L91

albertogasparin commented 1 year ago

Thanks @yamadapc !