Question:
I want to pass my data listed with map to modal. My data it looks like this on the screen:1 John watch
2 Karrie watch
3 Karen watch … like this
in the form of a table. All of the watch are buttons and when the button is clicked, the modal opens.
How can i show my data in modal when i click on buttons?
Answer:
Suggest to have a setIdShown setter. Which you can pass to your onClick function to set the Id of the item you want to show.In the modal, you can have a iDShown getter. You can then filter items by ID and show the data in the modal.
If you have better answer, please add a comment about this, thank you!