79216663

Date: 2024-11-22 21:53:26
Score: 2.5
Natty:
Report link

figured it by ChatGpt. The modal needs to be outside map function and i needed to make one more useState and with each click on the button that opens modal the setstate sets the current item in the map array as the one that needs to be shown in the modal. otherwise if you click on modal when its inside map function the state sets to true for all open modal buttons in the list

Reasons:
  • Blacklisted phrase (0.5): i need
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Danko Grgić