From 852c666a0b0ffa58fc9d369df220afc35860b8ff Mon Sep 17 00:00:00 2001 From: lukasgoetzweiss Date: Fri, 31 Jan 2025 13:35:48 -0700 Subject: [PATCH 1/3] added note about use client --- docs/sdks/client-sdks/javascript/react.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/sdks/client-sdks/javascript/react.mdx b/docs/sdks/client-sdks/javascript/react.mdx index 3635b25b..f9fed6b3 100644 --- a/docs/sdks/client-sdks/javascript/react.mdx +++ b/docs/sdks/client-sdks/javascript/react.mdx @@ -42,6 +42,10 @@ export default function EppoRandomizationProvider({ } ``` +:::note +If you are using Next.js, make sure this component is rendered client side by adding `"use client"` to the top of the file. +::: + 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: ```tsx From a1eb8729b325a36589813415987fbc586a7f8244 Mon Sep 17 00:00:00 2001 From: lukasgoetzweiss <54216345+lukasgoetzweiss@users.noreply.github.com> Date: Tue, 4 Feb 2025 08:26:55 -0700 Subject: [PATCH 2/3] Update docs/sdks/client-sdks/javascript/react.mdx --- docs/sdks/client-sdks/javascript/react.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/client-sdks/javascript/react.mdx b/docs/sdks/client-sdks/javascript/react.mdx index f9fed6b3..487147ab 100644 --- a/docs/sdks/client-sdks/javascript/react.mdx +++ b/docs/sdks/client-sdks/javascript/react.mdx @@ -43,7 +43,7 @@ export default function EppoRandomizationProvider({ ``` :::note -If you are using Next.js, make sure this component is rendered client side by adding `"use client"` to the top of the file. +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/]. ::: 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: From 3a7a7e377255f25ef07894056c9fc54d75404132 Mon Sep 17 00:00:00 2001 From: lukasgoetzweiss <54216345+lukasgoetzweiss@users.noreply.github.com> Date: Tue, 4 Feb 2025 21:14:44 -0700 Subject: [PATCH 3/3] Update docs/sdks/client-sdks/javascript/react.mdx Co-authored-by: Tyler Potter --- docs/sdks/client-sdks/javascript/react.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/client-sdks/javascript/react.mdx b/docs/sdks/client-sdks/javascript/react.mdx index 487147ab..6ad37ec4 100644 --- a/docs/sdks/client-sdks/javascript/react.mdx +++ b/docs/sdks/client-sdks/javascript/react.mdx @@ -43,7 +43,7 @@ export default function EppoRandomizationProvider({ ``` :::note -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/]. +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/). ::: 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: