File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export function useAccounts(status?: sdk.dappAPI.StatusEvent) {
2020 )
2121 } )
2222 }
23- } , [ status ] )
23+ } , [ status , setErrorMsg ] )
2424
2525 useEffect ( ( ) => {
2626 if ( status ?. isConnected ) {
Original file line number Diff line number Diff line change 1- import { StrictMode } from 'react'
1+ import { StrictMode , useState } from 'react'
22import { createRoot } from 'react-dom/client'
33import './index.css'
44import App from './App.tsx'
5- import { ErrorProvider } from './ErrorContext.tsx'
5+ import { ErrorContext } from './ErrorContext.tsx'
6+
7+ export function ErrorProvider ( { children } : { children : React . ReactNode } ) {
8+ const [ errorMsg , setErrorMsg ] = useState ( '' )
9+
10+ return (
11+ < ErrorContext . Provider value = { { errorMsg, setErrorMsg } } >
12+ { children }
13+ </ ErrorContext . Provider >
14+ )
15+ }
616
717createRoot ( document . getElementById ( 'root' ) ! ) . render (
818 < StrictMode >
You can’t perform that action at this time.
0 commit comments