showing results for - "create navigationcontainer ref not working"
Alison
31 Jun 2019
1// RootNavigation.js
2
3import * as React from 'react';
4
5export const navigationRef = React.createRef();
6
7export function navigate(name, params) {
8  navigationRef.current?.navigate(name, params);
9}
10
11
12 <NavigationContainer ref={navigationRef} >
13   
14   // your app componets
15 </NavigationContainer>
16//do not forgot to add (navigationRef) into your navigation container
17
18// add other navigation functions that you need and export them