DEV Community

Discussion on: An easy way to create a customize dynamic table in react js

Collapse
 
abdulbasit313 profile image
Abdul Basit

You can do two things.

  1. Write the logic that changes this object into array or array of objects.
  2. If you have hard coded data then write it in this way countries : [ { country : 'US', id: 1, } ] Something like this
Collapse
 
femi_akinyemi profile image
Femi Akinyemi

I think I will go with the first option. But will I be able to add the unique name and ID then

Thread Thread
 
abdulbasit313 profile image
Abdul Basit

Yes you can further spread the object or array. Read about spread operator

Thread Thread
 
femi_akinyemi profile image
Femi Akinyemi

Alright Thanks