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

If you are facing similar problem, this is coming up due to you miss the syntax of destructing or you have wrongly typed out your code, as I was doing, fix is below.

Example error code:

const [ value, name ] = e.target;

Should be:

const { value, name } = e.target;

Actually solution we could have found from error description itself, if we have glance properly to error text rather just copy paste it to search.

Anyways, its happens and we learn like this.

Thanks and enjoy.

Published by Post Maker

Hello I am post maker for this website.

Leave a comment

Your email address will not be published. Required fields are marked *