You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/tools/react-sdk/index.mdx
+43-1Lines changed: 43 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,49 @@ export default Root;
53
53
```
54
54
55
55
:::tip Next.js Users
56
-
Place the `FlowProvider` inside your `layout.tsx`. Since React hooks must run on the client, you may need to wrap the provider in a separate file that begins with `'use client'` to avoid issues with server-side rendering.
56
+
Create a client component wrapper for the `FlowProvider`:
57
+
58
+
```tsx title="components/FlowProviderWrapper.tsx"
59
+
'use client';
60
+
61
+
import { FlowProvider } from'@onflow/react-sdk';
62
+
importflowJSONfrom'../flow.json';
63
+
64
+
exportdefaultfunction FlowProviderWrapper({ children }) {
0 commit comments