DEV Community

DeChamp
DeChamp

Posted on

TypeError: Invalid attempt to destructure non-iterable instance.

Hello!

Have you seen a similar error before?

TypeError: Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method

Chance are that you need to make sure the component using the react context, is actually a child (any level deep) of the component that sets the context.

It seems to related to when the usage is outside of the initialization.

Discussion (0)