Skip to content

Commit 31503a0

Browse files
authored
Update vite.md
1 parent 1529ff6 commit 31503a0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/installation/vite.md

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

37+
Or if you want react-scan to run in production
38+
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+
});
47+
```
48+
3749
> [!CAUTION]
3850
> 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.
3951

0 commit comments

Comments
 (0)