Skip to content

Commit f5e964b

Browse files
Migrate example to static
1 parent da8957a commit f5e964b

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

versioned_docs/version-7.x/devtools.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ title: Developer tools
44
sidebar_label: Developer tools
55
---
66

7+
import Tabs from '@theme/Tabs';
8+
import TabItem from '@theme/TabItem';
9+
710
Developer tools to make debugging easier when using React Navigation.
811

912
To use the developer tools, install [`@react-navigation/devtools`](https://github.com/react-navigation/react-navigation/tree/master/packages/devtools):
@@ -26,9 +29,38 @@ This hook provides integration with [Redux DevTools Extension](https://github.co
2629

2730
To use the hook, import it and pass a `ref` to the `NavigationContainer` as its argument:
2831

32+
<Tabs groupId="config" queryString="config">
33+
<TabItem value="static" label="Static" default>
34+
35+
```js
36+
import * as React from 'react';
37+
import {
38+
createStaticNavigation,
39+
useNavigationContainerRef,
40+
} from '@react-navigation/native';
41+
import { useReduxDevToolsExtension } from '@react-navigation/devtools';
42+
43+
/* content */
44+
45+
export default function App() {
46+
const navigationRef = useNavigationContainerRef();
47+
48+
useReduxDevToolsExtension(navigationRef);
49+
50+
return <Navigation ref={navigationRef} />;
51+
}
52+
```
53+
54+
</TabItem>
55+
56+
<TabItem value="dynamic" label="Dynamic" default>
57+
2958
```js
3059
import * as React from 'react';
31-
import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native';
60+
import {
61+
NavigationContainer,
62+
useNavigationContainerRef,
63+
} from '@react-navigation/native';
3264
import { useReduxDevToolsExtension } from '@react-navigation/devtools';
3365

3466
export default function App() {
@@ -42,4 +74,7 @@ export default function App() {
4274
}
4375
```
4476

77+
</TabItem>
78+
</Tabs>
79+
4580
Now, you'll be able to see logs from React Navigation in Redux DevTools Extension, e.g. when you're debugging your app with React Native Debugger app.

0 commit comments

Comments
 (0)