nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 181 forks source link

How can I get navigation prop by solito? #231

Closed arshelia closed 1 year ago

arshelia commented 2 years ago

I had an old native app which use react-navigation4.x, and had tried migrated it to build web application by solito as well. The first difficulty blocked me is how can I get navigation prop with solito, for the 4.x, I can use api as belows: import { useNavigation } from 'react-navigation-hooks But is solito, navigation is not export at useRouter, and I wondered is there any solution or plane to enhance navigation functionality?

nandorojo commented 2 years ago

what features of navigation do you need? have you read the docs for screen parameters and tree shaking?

arshelia commented 2 years ago

what features of navigation do you need? have you read the docs for screen parameters and tree shaking?

For example, StackActions.reset and navigation.addListener. But as you metioned above, maybe I can try to create platform-specific module including the features that I need.

nandorojo commented 2 years ago

In these cases, I would create platform-specific modules. But also make sure you need them first!

nandorojo commented 2 years ago

Also, if it helps, I just released a feature to use StackActions.replace with Solito: https://github.com/nandorojo/solito/releases/tag/v1.1.2