Skip to content

Commit 2e5870b

Browse files
Added note about "use client" to React docs (#584)
* added note about use client * Update docs/sdks/client-sdks/javascript/react.mdx * Update docs/sdks/client-sdks/javascript/react.mdx Co-authored-by: Tyler Potter <[email protected]> --------- Co-authored-by: Tyler Potter <[email protected]>
1 parent c7875f2 commit 2e5870b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/sdks/client-sdks/javascript/react.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export default function EppoRandomizationProvider({
4242
}
4343
```
4444

45+
:::note
46+
If you are using Next.js, make sure this component is rendered client side by adding `"use client"` to the top of the file. For more details on using Eppo in Next.js, see [here](/sdks/client-sdks/javascript/nextjs-setup/).
47+
:::
48+
4549
After the SDK is initialized, you may assign variations from any child component of `EppoRandomizationProvider`. We recommend wrapping the SDK code in a [useMemo hook](https://reactjs.org/docs/hooks-reference.html#usememo) to avoid invoking the assignment logic on every render:
4650

4751
```tsx

0 commit comments

Comments
 (0)