Open definito opened 3 years ago
same problem with my code also if you got the solution could please explain here
This is because the state is shared.
class App extends React.Component {
constructor () {
super()
this.state = {
isOpen: false,
isOpen2: false,
}
}
render () {
return (
<React.Fragment>
<div class="container">
<ModalVideo channel='youtube' isOpen={this.state.isOpen} videoId='L61p2uyiMSo' onClose={() => this.setState({isOpen: false})} />
<a class="thumb multimedia-icon-video big js-video-button" onClick={() => { this.setState({isOpen: true})}}>
モーダル1
</a>
</div>
<div class="col-12">
<ModalVideo channel='vimeo' isOpen={this.state.isOpen2} videoId='132793529' onClose={() => this.setState({isOpen2: false})} />
<a class="thumb multimedia-icon-video js-video-button" onClick={() => { this.setState({isOpen2: true})}}>
モーダル2
</a>
</div>
</React.Fragment>
)
}
}
!!Multiple video link getting only the last link... Any solution?