#Type error: Type 'Dispatch<SetStateAction<string>>' is not assignable to type '() => void'. Target

7 messages · Page 1 of 1 (latest)

round stirrup
#

Any help with this probably obvious error? Have only just started using React, and trying to build on Berkeley on remote server, but having this error for one of the pages within ui directory

10 | const [userRole, setUserRole] = useState('');
11 | return (

12 | <UserTypeContext.Provider value={{ userRole, setUserRole }}>
| ^
13 | <Component {...pageProps} />
14 | </UserTypeContext.Provider>
15 | );

hallow idol
#

Doesnt look like zkapps related, but whats the type of your context?

abstract stag
#

Agreed this error doesnt look like it is related to zkapps.

round stirrup
#

i appreciate it might not be directly zkapps related but its related to the UI of my zkapp through react. So was wondering about any advice how to debug?

#

these pages along with sidebar are the only uses of context

round stirrup