React
SSR and Hydration

SSR and Hydration

If you are not using SSR or want to deal with hydration mismatch errors to get a faster first load of W3, you can ignore the SSR flag and remove the W3 component.

import { initW3, Injected, WalletConnect } from '@w3vm/react'
 
/* Icons */
import walletconnect from 'public/walletconnect.svg'
import wallet from 'public/extension-wallet.png'
 
/* WalletConnect Project Id */
const projectId = 'YOUR_PROJECT_ID'
 
initW3({
  connectors: [
    new Injected({ icon: wallet }), 
    new WalletConnect({ projectId, icon: walletconnect, showQrModal: true })
  ],
  chains:[1, 137],
})
 
export default function App({ Component, pageProps }: AppProps) {
  return <Component {...pageProps} />
}