File tree 3 files changed +16
-1
lines changed
versioned_docs/version-5.x
3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
node_modules
2
2
.DS_Store
3
3
.docusaurus
4
+ .history
4
5
5
6
build /
6
7
translated_docs /
Original file line number Diff line number Diff line change @@ -35,11 +35,18 @@ function Settings({ navigation }) {
35
35
) ;
36
36
}
37
37
38
+ const Stack = createStackNavigator ( ) ;
39
+
38
40
export default function App ( ) {
39
41
const routeNameRef = React . useRef ( ) ;
40
42
const navigationRef = React . useRef ( ) ;
41
43
42
- const Stack = createStackNavigator ( ) ;
44
+ React . useEffect ( ( ) => {
45
+ const state = navigationRef . current . getRootState ( ) ;
46
+
47
+ // Save the initial route name
48
+ routeNameRef . current = getActiveRouteName ( state ) ;
49
+ } , [ ] ) ;
43
50
44
51
return (
45
52
< NavigationContainer
Original file line number Diff line number Diff line change @@ -38,6 +38,13 @@ export default function App() {
38
38
const routeNameRef = React .useRef ();
39
39
const navigationRef = React .useRef ();
40
40
41
+ React .useEffect (() => {
42
+ const state = navigationRef .current .getRootState ();
43
+
44
+ // Save the initial route name
45
+ routeNameRef .current = getActiveRouteName (state);
46
+ }, []);
47
+
41
48
return (
42
49
< NavigationContainer
43
50
ref= {navigationRef}
You can’t perform that action at this time.
0 commit comments