To make it more clear , basically what I'm trying to do is like Amazon
There will be a bunch of products and once you click on the product ,Only that product and its details will be displayed on the Popup Modal.
In my case , I have stored 3 data in an Array, I have mapped it out Which creates 3div and 3Modal Popup with buttons in each.
Once I click on the button of 1st div , I want the modal to be open for that first div only.
But right now when I click on the button all 3 Modal Popup.
I'm new to React , I can do this same thing in JQuery and Javascript, But I'm not able to achieve this in React.
Or is there a better approach to this ? Like rather than looping and creating 3modal popup Can we create just one modal popup, That will display the data of the particular div of which button is being clicked?
My Current Code:
App.js , Where i have created the Array
Product.Js Where its being mapped out into 3div and also has the modal popup
Let me know if you guys need more details
Thank you guys.
3 Div that is being dunamically created with the data from array
But when i Click on any button , popup for all div pops up , Thats the issue