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

fix unstable QueryClient and configs in React "Getting Started" guide #15

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
42 changes: 21 additions & 21 deletions docs/pages/react/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ import { WagmiProvider, createConfig, http } from "wagmi"
import { sepolia, arbitrum } from "wagmi/chains"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"

export default function Providers({ children }: { children: React.ReactNode }) {
const wagmiConfig = createConfig({
chains: [arbitrum, sepolia],
transports: {
[arbitrum.id]: http(),
[sepolia.id]: http(),
},
})
const zdConfig = createZdConfig({
chains: [arbitrum, sepolia],
transports: {
[arbitrum.id]: http(),
[sepolia.id]: http(),
},
projectIds: {
[arbitrum.id]: ZERODEV_ARB_PROJECT_ID,
[sepolia.id]: ZERODEV_SEPOLIA_PROJECT_ID
}
})
const queryClient = new QueryClient()
const wagmiConfig = createConfig({
chains: [arbitrum, sepolia],
transports: {
[arbitrum.id]: http(),
[sepolia.id]: http(),
},
})
const zdConfig = createZdConfig({
chains: [arbitrum, sepolia],
transports: {
[arbitrum.id]: http(),
[sepolia.id]: http(),
},
projectIds: {
[arbitrum.id]: ZERODEV_ARB_PROJECT_ID,
[sepolia.id]: ZERODEV_SEPOLIA_PROJECT_ID
}
})
const queryClient = new QueryClient()

export default function Providers({ children }: { children: React.ReactNode }) {
return (
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
Expand All @@ -71,4 +71,4 @@ export default function Providers({ children }: { children: React.ReactNode }) {

## Next Steps

The best way to learn how to use `@zerodev/waas` is by looking at [the examples](https://github.com/zerodevapp/waas-examples) and browsing the hooks on the sidebar.
The best way to learn how to use `@zerodev/waas` is by looking at [the examples](https://github.com/zerodevapp/waas-examples) and browsing the hooks on the sidebar.