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:
forcing people to install react-router even if they don't use it
limiting the routers our Link component works with
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.
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 onreact-router
in theLink
component, we are:react-router
even if they don't use itLink
component works withI 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. TheNautilus
HOC should support adefaultLink
or something that passes things toLink
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 makea
tags the default component if no router is specified. I'm okay with that sort of minimal level of setup.