Is it possible to navigate from app.js with React Navigation?

603 Views Asked by At

I am switching over from react-native-router-flux to react-navigation v6.

I have my navigation wired up again for the most part, I am now struggling to navigate from app.js. I navigate from here only to handle notification navigation.

It seems like you can only access the navigation prop from screens that are stacks. I tried to add app.js to a stack but that did not work either...

I also tried the hook useNavigation() but I was not able to because app.js is a class component...

This was easy and out of the box with RNRF, is there something I am missing here with React Navigation v6?

1

There are 1 best solutions below

0
On BEST ANSWER

Navigating to screens with no access to navigation props using createNavigationContainerRef. More details (Added this to answer section from my comment)