I have a problem showing a list of buttons where each would display a popup. I have taken react-modal (https://github.com/reactjs/react-modal) component and able to display a single popup on button click, but how would i do it for list of buttons? I ve read about refs collection, but there is seem no way of changing props collection accessing and components by refs name?
Having a show button:
<button type="button" onClick={this.openModal}>Show</button>
openModal function:
openModal: function(ref) {
this.setState({isOpened: true});
}
But how should i set a state value for particular button instance? i can make by giving each isOpened state value particular name: isOpened-1, isOpened-2 and so on, but i guess its not a proper way. Im just learning ReactJS.