Open just-a-normal-human opened 2 years ago
I can remove the first error by changing
return <MetaMaskContext.Provider value={values}>{children}</MetaMaskContext.Provider>
to
return <MetaMaskContext.Provider {...values}>{children}</MetaMaskContext.Provider>
and commenting out the value in index.d.ts , (not sure if this is good idea though)
// Context via RenderProps
interface ProviderProps<T> {
//value: T;
children?: ReactNode | undefined;
}
But in any case that doesn't solve the second error.
Sorry @just-a-normal-human I haven't done this yet in TypeScript but I am assuming that your second error is being produced because the connect function is not being passed correctly... Not too sure, but that seems to be what the second error is saying. You're getting a null value from this.
Hey man, Thanks for the guide!
I'm having some trouble integrating the code with TypeScript, hoping you could help.
In the return statement of MetaMaskProvider
I get error saying
in my index.d.ts i have
When I import useMetaMaskProvider
I get error on all variables saying the same:
Do you have any tips on how I could modify the code so its useable with TypeScript?
Thanks!