frontarm / navi

🧭 Declarative, asynchronous routing for React.
https://frontarm.com/navi/
MIT License
2.07k stars 71 forks source link

navi as react-native router #154

Closed gut4 closed 4 years ago

gut4 commented 4 years ago

Is it possible to use navi as react-native router?

jamesknelson commented 4 years ago

It may be possible, but I've never tried it myself. If you do try this, you'd need to write your own integrations for e.g. deep linking and the Android back button.

gut4 commented 4 years ago

Looks like it can work with Navi.createMemoryNavigation and useNavigation But there is a problem with hashScroll: https://github.com/frontarm/navi/blob/5a1762bfc8f8b2d30d810e1578f76aa41192d4f8/packages/react-navi/src/HashScroll.tsx#L23 So for react-native we need to disable hashScroll somehow as there is no window

jamesknelson commented 4 years ago

I see. Seems like there needs to be an option to pass a HashScrollBehavior of none.

If you're up to submitting a PR, this should be a pretty easy change. Otherwise I'll see if I can give it a shot this weekend or next weekend.