I’ve got an Uncaught TypeError: Invalid attempt to spread non-iterable instance because of I miss a curly bracket when I receiving data from parent component, and I used this data to render a list.

Here is the error:

Here is the code:

Here is the console log data:

There are 2 ways to fix this problem:

  • get the array from the object rather than directly put an object as a datasource, shown as follow:

  • add a curly bracket when you receving the data, code shown as follow:

This is the console log data after adding curly bracket to receive data

Any feedback is welcome! :-)