Skip to content

Commit 8eaacef

Browse files
committed
update docs
1 parent 82b7051 commit 8eaacef

File tree

9 files changed

+48
-22
lines changed

9 files changed

+48
-22
lines changed

docs/installation/astro.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ Add the script to your root layout
4242
</body>
4343
</html>
4444
```
45+
46+
If you want react-scan to also run in production, use the react-scan/all-environments import path
47+
```diff
48+
- import { scan } from "react-scan";
49+
+ import { scan } from "react-scan/all-environments";
50+
```

docs/installation/create-react-app.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,10 @@ scan({
3535
enabled: true,
3636
});
3737
```
38-
Or if you want react-scan to run in production
39-
40-
```jsx
41-
// src/index
42-
43-
// must be imported before React and React DOM
44-
import { scan } from "react-scan/all-environments";
45-
import React from "react";
46-
47-
scan({
48-
enabled: true,
49-
});
38+
If you want react-scan to also run in production, use the react-scan/all-environments import path
39+
```diff
40+
- import { scan } from "react-scan";
41+
+ import { scan } from "react-scan/all-environments";
5042
```
5143

5244
> [!CAUTION]

docs/installation/next-js-app-router.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ If you want react-scan to also run in production, use the react-scan/all-environ
6868
```diff
6969
- import { scan } from "react-scan";
7070
+ import { scan } from "react-scan/all-environments";
71-
```
71+
```

docs/installation/next-js-page-router.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,10 @@ export default function App({ Component, pageProps }) {
4848
return <Component {...pageProps} />;
4949
}
5050
```
51+
52+
53+
If you want react-scan to also run in production, use the react-scan/all-environments import path
54+
```diff
55+
- import { scan } from "react-scan";
56+
+ import { scan } from "react-scan/all-environments";
57+
```

docs/installation/react-router.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,11 @@ export function Layout({ children }) {
7373
// ...
7474
```
7575

76+
If you want react-scan to also run in production, use the react-scan/all-environments import path
77+
```diff
78+
- import { scan } from "react-scan";
79+
+ import { scan } from "react-scan/all-environments";
80+
```
81+
7682
> [!CAUTION]
7783
> React Scan must be imported before React (and other React renderers like React DOM), as well as React Router, in your entire project, as it needs to hijack React DevTools before React gets to access it.

docs/installation/remix.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ export default function App() {
8686
}
8787
```
8888

89+
If you want react-scan to also run in production, use the react-scan/all-environments import path
90+
```diff
91+
- import { scan } from "react-scan";
92+
+ import { scan } from "react-scan/all-environments";
93+
```
94+
8995
> [!CAUTION]
9096
> React Scan must be imported before React (and other React renderers like React DOM), as well as Remix, in your entire project, as it needs to hijack React DevTools before React gets to access it.
9197

docs/installation/rsbuild.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,11 @@ scan({
5555
});
5656
```
5757

58+
If you want react-scan to also run in production, use the react-scan/all-environments import path
59+
```diff
60+
- import { scan } from "react-scan";
61+
+ import { scan } from "react-scan/all-environments";
62+
```
63+
5864
> [!CAUTION]
5965
> React Scan must be imported before React (and other React renderers like React DOM) in your entire project, as it needs to hijack React DevTools before React gets to access it.

docs/installation/tanstack-start.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,10 @@ hydrateRoot(document, <StartClient router={router} />);
9090

9191
> [!CAUTION]
9292
> This only works for React 19
93+
94+
If you want react-scan to also run in production, use the react-scan/all-environments import path
95+
96+
```diff
97+
- import { scan } from "react-scan";
98+
+ import { scan } from "react-scan/all-environments";
99+
```

docs/installation/vite.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,14 @@ scan({
3434
});
3535
```
3636

37-
Or if you want react-scan to run in production
37+
If you want react-scan to also run in production, use the react-scan/all-environments import path
3838

39-
```jsx
40-
// src/index
41-
import { scan } from "react-scan/all-environments"; // must be imported before React and React DOM
42-
import React from "react";
43-
44-
scan({
45-
enabled: true,
46-
});
39+
```diff
40+
- import { scan } from "react-scan";
41+
+ import { scan } from "react-scan/all-environments";
4742
```
4843

44+
4945
> [!CAUTION]
5046
> React Scan must be imported before React (and other React renderers like React DOM) in your entire project, as it needs to hijack React DevTools before React gets to access it.
5147

0 commit comments

Comments
 (0)