Skip to content
Advertisement

how to Iterate through data and pass them into a component in reactjs

I already created a menu button which display some default value, shows below.enter image description here

And I have a table which have the data I need,

JavaScript

I want to put the value, “DELETE COMMENT 1” in my menu list, how can I do this? enter image description here

I tried something like this, loop through the cell, but got error “cell.map” is not a function

JavaScript

Edit:

JavaScript
JavaScript

Advertisement

Answer

Since you need to modify the menu list (NotesSelection) pass the value to that component and render it there.

NotesSelection component

JavaScript

Table component

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement