Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update implementation.mdx #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/appkit/next/ethers5/implementation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ In this example we will create a new file called `context/appkit.tsx` outside ou
```tsx
'use client'

import { createContext } from 'react'
import { createAppKit } from '@reown/appkit/react'
import { Ethers5Adapter } from '@reown/appkit-adapter-ethers5'
import { mainnet, arbitrum } from '@reown/appkit/networks'
Expand All @@ -22,7 +23,7 @@ const metadata = {
}

// 3. Create the AppKit instance
createAppKit({
const appkit = createAppKit({
adapters: [new Ethers5Adapter()],
metadata: metadata,
networks: [mainnet, arbitrum],
Expand All @@ -32,10 +33,12 @@ createAppKit({
}
})

export function AppKit() {
const AppKitContext = createContext(appkit);

export function AppKit({ children }: { children: React.ReactNode }) {
return (
<YourApp /> //make sure you have configured the <appkit-button> inside
)
<AppKitContext.Provider value={appkit}>{children}</AppKitContext.Provider>
);
}
```

Expand Down