Skip to content

Commit 653eca4

Browse files
authored
Fix docs (#268)
1 parent 6e5438f commit 653eca4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ Create a `<ReactScan>` client component:
2626
```jsx
2727
// path/to/ReactScanComponent
2828
"use client";
29-
import { JSX, useEffect } from "react";
29+
// react-scan must be imported before react
3030
import { scan } from "react-scan";
31+
import { JSX, useEffect } from "react";
3132

3233
export function ReactScan(): JSX.Element {
3334
useEffect(() => {
@@ -43,6 +44,9 @@ export function ReactScan(): JSX.Element {
4344
Import the `<ReactScan>` component into `app/layout`:
4445

4546
```jsx
47+
// app/layout
48+
49+
// This component must be the top-most import in this file!
4650
import { ReactScan } from "path/to/ReactScanComponent";
4751

4852
// ...
@@ -51,7 +55,7 @@ export default function RootLayout({ children }) {
5155
return (
5256
<html lang="en">
5357
<ReactScan />
54-
<body className={`${geistSans.variable} ${geistMono.variable}`}>
58+
<body>
5559
{children}
5660
</body>
5761
</html>

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ export default function Document() {
3030
Add the following code to your `App` component in `pages/_app`:
3131

3232
```jsx
33+
// react-scan must be the top-most import
34+
import { scan } from "react-scan";
3335
import "@/styles/globals.css";
3436
import type { AppProps } from "next/app";
3537
import { useEffect } from "react";
36-
import { scan } from "react-scan";
3738

3839
export default function App({ Component, pageProps }: AppProps) {
3940
useEffect(() => {

docs/installation/tanstack-start.md

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Add the following code to your `<RootDocument>` component at `app/routes/__root`
3636

3737
```jsx
3838
// app/routes/__root.jsx
39+
// react-scan must be imported before React and TanStack Start
3940
import { scan } from "react-scan";
4041
import { Meta, Scripts } from "@tanstack/start";
4142
import { useEffect } from "react";

0 commit comments

Comments
 (0)