skip to Main Content

enter image description here

Hey friends, so what happened is I developed a rest API using Nodejs Express and Mysql, It is working fine on my local machine, I then hosted it on Cpanel, now I am trying to fetch data from it and render it on my react app. Well fetching the data part works like magic, its even rendering in my console, but when I map the data on my react app it is giving the error below, and just a blank white page. May you please assist .

2

Answers


  1. If the data object is still in a nested object (aka JSON) format, then using .map() on it won’t work, as .map() is not a function for Objects.

    Try converting data to an array of objects then use .map().

    Login or Signup to reply.
  2. You can grab all the values with Object.values and push into an array that you can map

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search