• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: React.js – Passing data listed with map to modal

Resolved: React.js – Passing data listed with map to modal

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

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!

javascript reactjs
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to make statement case insensitive when uploading a dta file with specified columns?

27/03/2023

Resolved: Sort dataframe columns value by close it to another column

27/03/2023

Resolved: PostgreSQL resample 1 minute OHLCV candle data into 5 minute OHLCV candle data

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

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