Skip to content

Commit

Permalink
docs: fix useChain and setChain documentation (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
avarobinson authored Jul 23, 2024
1 parent dcc0317 commit 9ebf009
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions site/pages/react/useChain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ The currently connected chain.
### setChain

A function that allows you to set the current chain. The chain **must** be included in your config's `connections` array.

Parameters for setChain - `chain`: an object of type `Chain` (ex. `setChain({chain: Chain})`)
2 changes: 1 addition & 1 deletion site/snippets/react/useChain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function ComponentWithUseChain() {
return (
<div>
<p>{chain.id}</p>
<button onClick={() => setChain(optimism)}>
<button onClick={() => setChain({ chain: optimism })}>
Change Chain to Optimism
</button>
</div>
Expand Down

0 comments on commit 9ebf009

Please sign in to comment.