octopusthink / nautilus

Inclusive, open-source design system and React component library.
https://nautilus.octopusthink.com
MIT License
2 stars 0 forks source link

Allow different underlying `Link` components to be used by Link #147

Closed tofumatt closed 5 years ago

tofumatt commented 5 years ago

So, I'd like for our default router to be @reach/router, but in working with a Gatsby template I realised that because we are directly importing/relying on react-router in the Link component, we are:

I don't really care which router people use, but by default because we'll be using @reach/router (see: #146), it's the API I'll match in our default component.

But I think we should allow for Link to accept a prop link _component or something that allows for the underlying component to be specified. The Nautilus HOC should support a defaultLink or something that passes things to Link and is set to @reach/router by default if we can do that. Maybe we can't handle conditional imports like that and might have to make a tags the default component if no router is specified. I'm okay with that sort of minimal level of setup.