• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to render an array of objects in React as it says objects cant be child elements

Resolved: How to render an array of objects in React as it says objects cant be child elements

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I am storing the response from an API in an array called Products. This array stores the objects returned. I am displaying the title property of the objects in a div. But getting objects cant be child elements in React error. What should I do? Also, I have tried rendering the products title (eg: Products[0].title) but even this doesn’t work. But this is not an object. So why doesn’t this work?
Code on React:

Answer:

you can do this


If you have better answer, please add a comment about this, thank you!

fetch-api reactjs
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to set consistent decimal separators in R data frame?

26/03/2023

Resolved: How to resolve LNK2001 in c++ projects

26/03/2023

Resolved: How to correctly initialize vector of number in Typescript

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.