Skip to content

Commit e005df1

Browse files
committed
docs: update troubleshooting section of use client error on Next.js
1 parent fc14093 commit e005df1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/docs/troubleshooting.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,15 @@ Less ideally, if you're unable to upgrade, you can set `swcMinify: false` on you
7373

7474
## Next.js `"use client"` error
7575

76-
This normally happens when you use react-tooltip inside a component that is not tagged as client component.
76+
This normally happens when you use `react-tooltip` inside a component that is not tagged as client component. For more info, see the [Next.js docs](https://nextjs.org/docs/getting-started/react-essentials#client-components).
7777

78-
To use react-tooltip on Next.js 13 without had to tag your component or page as client component, just create a new file `react-tooltip.tsx` and place the following code inside of the created file:
78+
To use `react-tooltip` on Next.js 13 without having to tag your component or page as a client component, just create a new file `ReactTooltip.tsx` (for this example, the file path is `src/components/ReactTooltip.tsx`) and place the following code inside of the created file:
79+
80+
:::caution
81+
82+
Avoid naming the file `react-tooltip.tsx` (or with whichever extension your project uses), since it may interfere with your editor's autocomplete funcionality.
83+
84+
:::
7985

8086
```jsx
8187
// src/components/ReactTooltip.tsx

0 commit comments

Comments
 (0)