reach / router

https://reach.tech/router
MIT License
6.89k stars 327 forks source link

responsive routes #200

Open evdama opened 5 years ago

evdama commented 5 years ago

I've been through the docs but didn't find anything regarding responsive routes. There's navigate that could be used to do that I guess?

niccai commented 5 years ago

I suspect you might want to manage this separately from the Router - thus in turn allowing you to use different Router components per device vs including this logic as part of the router. With that said, I think different routes per device is something you should try to avoid. I'm not sure, but I suspect it'll create issues with chunking and other optimizations.

mtliendo commented 5 years ago

Responsive routes could be added with multiple routers that conditionally render based on the viewport, however as @niccai mentioned, you'd likely wan to use dynamic imports to lazy load your routes to avoid package bloat.