Anchor: History API navigation #758
-
In our team's migration to Paste Anchors, it seems like client-side navigation (e.g. navigation via History API) is not supported. Assuming that decision was to stay decoupled from any third-party navigations libraries, would it be possible to support client-side navigation with a plugin system like material UI? https://material-ui.com/guides/composition/#routing-libraries |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @vnguyen94, you're right we don't want the presentational component to be tied to any particular routing implementation. Ideas and preferences change over time, and we're really only concerned with the component being an HTML anchor element that has certain styles attached to it. So we leave the routing library of choice up to the consumer. I am curious though on the preference of the Paste anchor being the accommodator of the routing library. As an example react router has 2 mechanisms you could hook into, that accommodates other React components to be used with the library. Firstly is the Link component takes a The second option is the These hopefully should work just fine with our Anchor and save us the problem of trying to type the component to an unspecified API. For example, if we were to expose the If we reverse that, and expect our Anchor to work with other routing libraries as a consumable, that seems like the most flexibility we could provide in the long term to the library. |
Beta Was this translation helpful? Give feedback.
Hi @vnguyen94, you're right we don't want the presentational component to be tied to any particular routing implementation. Ideas and preferences change over time, and we're really only concerned with the component being an HTML anchor element that has certain styles attached to it. So we leave the routing library of choice up to the consumer.
I am curious though on the preference of the Paste anchor being the accommodator of the routing library.
As an example react router has 2 mechanisms you could hook into, that accommodates other React components to be used with the library. Firstly is the Link component takes a
component
prop, where you can pass it a styled component. https://reactro…