Questions tagged [react-navigation-v6]

Version 6 of the routing and navigation library for Expo and React Native apps.

Only use this tag for when V6 specific cases are involved.

See the official docs for changes compared to : https://reactnavigation.org/docs/6.x/upgrading-from-5.x#general-changes

251 questions
4
votes
2 answers

React Navigation v6 usePreventRemoveContext is undefined error

TypeError: (0, _$$_REQUIRE(_dependencyMap[1], "@react-navigation/native").usePreventRemoveContext) is not a function. (In '(0, _$$_REQUIRE(_dependencyMap[1], "@react-navigation/native").usePreventRemoveContext)()', '(0,…
4
votes
0 answers

Partially transparent modal overlay screen with previous screen in the background in react navigation 5 or 6?

We are currently using react-navigation (5.6) in our react native app. We use a BottomTabNavigator as the root navigation. const BottomTab = createBottomTabNavigator() The individual screens under this BottomTab.Navigator are navigators themselves.…
4
votes
1 answer

Swipe Gesture not working in React Navigation v6 in IOS build

I am using Expo SDK 43 and React Navigation v6 for my react native app. I have used React Drawer Navigation in my app navigation. In the development mode inside expo, drawer open and close functions are working perfectly along with Swipe right…
Subhasis Laha
  • 101
  • 1
  • 7
4
votes
3 answers

React navigation - react native - How to block drawer in Stack Navigator nested inside Drawer Navigator?

In my react native app I have a stack navigator nested inside a drawer navigator. I want the drawer to be disabled in the stack navigator pages. I'm using react navigation 6. In the docs (https://reactnavigation.org/docs/drawer-navigator/#options) I…
4
votes
4 answers

Navigating without the navigation prop - typescript typings

I'm trying to include React Navigation 6.x into a React Native project with Redux and therefore need to be able to access the navigator from outside components. I'm following this guide (Navigating without the navigation prop) and have essentially…
4
votes
1 answer

How do you implement React-native-gesture-handler with React Navigation 6.x Native Stack Navigator (RN>0.6)?

So, I am building a prototype android app as an internship project for a startup in React Native v0.66. I was new to RN but not React when I set up the project. My choice for navigation fell upon React Navigation 6.x and their Native Stack Navigator…
4
votes
1 answer

Why is my navigation ref not ready in React Navigation 6 with Redux?

In React Navigation 6, my research shows that to navigate without a prop I should make a reference and use createNavigationContainerRef. I'm able to pass down the screen name to my dispatch but for some reason when I evaluate the condition with…
3
votes
3 answers

WARN Sending `onAnimatedValueUpdate` with no listeners registered

I got stuck. I am developing a mobile application with React Native CLI & React Navigation 6.x Then when i use material top tabs navigator, swiping through left to right or right to left. It always send a warn I've tried useFocusEffect,…
3
votes
3 answers

React navigation 6 - navigating from one stack A to stack screen B - why screen B wont call useEffect (but renders)?

I have a nested tabs navigator inside a stack navigator. When I navigate from Tab Screen A to Stack Screen B, B's useEffect is called, all good. When I navigate from Stack Screen C to also Stack Screen B, B's useEffect is NOT called. I dont…
3
votes
1 answer

"Found screens with the same name nested inside one another" after upgrade to react-navigation v6

I've seen other people with the same issue but I can't get my code to work. After upgrading from RN 5 to RN 6, I get the error below. Found screens with the same name nested inside one another. Check: AppSideDrawerScreen > HomeSide > HomeBottom,…
remyremy
  • 3,548
  • 3
  • 39
  • 56
3
votes
4 answers

How to get rid of white flashes on navigation using @react-navigation/native and @react-navigation/native-stack

Whenever I navigate to another screen,the screen flashes white as the screen navigated to seems to fade in. I built the app to both have a light and dark mode; this would have been fine for light mode but in dark mode the white flash is annoying and…
3
votes
1 answer

Typescript: Partial typing a react-navigation spy helper

(This is somewhat related to this three year-old post. I have tried to to follow the answers but they did not resolve my problem.) I want to build a general mock (spy) navigator that I can pass in like I do here with spyNavigation: it('shows an…
Norfeldt
  • 8,272
  • 23
  • 96
  • 152
3
votes
2 answers

useFocusEffect runs every time useState updates

I've been trying to use useState inside useFocusEffect. Following react-navigation I got something like this: const [counter, setCounter] = useState(0); useFocusEffect( useCallback(() => { console.log(counter); }, [counter]), …
3
votes
2 answers

Testing React Native app: How to fix: navigation.setOptions is not a function?

Here is the test: describe('', () => { it('Renders correctly', () => { // const setOptions = jest.fn(); // 1 // const setOptions = (navigation: any, route: any) => { } // 2 // const setOptions = (props: HomeProps) => { } // 3 // …
3
votes
5 answers

React Navigation: Force screen to animate from left to right

With React Navigation v6.x and using the .navigate() function, new views always animate from right to left. Typically this is fine, but I have a couple views that I always want to load from the left. I have tried to read the docs, code examples, and…
Cam Tullos
  • 2,537
  • 1
  • 21
  • 18
1
2
3
16 17