I am trying to solve this error for a few days now, I'm trying to pass context to my components, whatever I try, I get the error "The object is not a function" or "The object is not iterable"
I was trying to do this with Typescript, and I thought it might be something else, so I tried using react javascript cli and here are the errors below with my code pictures.
The value of the context is
{state,setState}
not[state,setState]
Just do this:
and you will see that the context is an object with two properties -
state
andsetState
as given by this line:Also, post code, don't post pictures of code.