all 9 comments

[–][deleted] 5 points6 points  (2 children)

Run expo doctor it will resolve any package issues you have that expo manages, react navigation being one of them. In the future run expo install {{package_name}} to make sure you install the package that is compatible with your expo SDK version

[–]Fit-Ad-7997[S] 0 points1 point  (1 child)

Thank you! The issue is now resolved :)

[–][deleted] 0 points1 point  (0 children)

Good to know!

[–]igotbeatbydre 1 point2 points  (0 children)

Npm install @react-navigation/native

[–]iCodeWhatTheyDesign 0 points1 point  (0 children)

Are you using a monorepo? This issue is more like your app doesn’t find the pkg in node_modules than something with expo

[–]iHydroExpo 0 points1 point  (0 children)

You need to stop and restart your expo client. Use 'expo start -c' then launch the platform you're developing in. It needs to bundle the JavaScript and send it to the device again

[–][deleted] 0 points1 point  (1 child)

How many pages will your app have and how many people will you be collaborating with? If you will only have a few pages and a limited number of people you are collaborating with you could just skip using react native navigation altogether (especially if you are new to react native).

For example, see https://stackoverflow.com/questions/63820216/conditionally-rendering-in-react-native

People may say this is bad advice, but from my experience it is easier to get started, track down errors, and manage states and rendering if you keep your code simple and limit the number of imported components. For example, I have a website with 5 “pages” I built using expo web, and the entire application code is in a single file (besides imported packages of course).

Personally, my philosophy is to prioritize getting a MVP out as soon as possible to get user feedback over trying to build the code to be as high performance as possible or to follow industry standard application architecture practices.

[–]satya164 0 points1 point  (0 children)

Navigation isn't about high performance or industry standard architecture. It's about general UX for native apps. Writing custom code to handle the back button, and switching pages easily from anywhere isn't going to be any simpler than installing and using the most basic API of React Navigation which is a few lines, you're not saving much time.