我正在使用此反应式视频组件https://appleple.github.io/react-modal-video/,但道具videoId = {this.props.video}不起作用,您能解释一下为什么吗?我使用的代码是:
class Video extends React.Component {
constructor () {
super()
this.state = {
isOpen: false
}
this.openModal = this.openModal.bind(this)
}
openModal () {
this.setState({isOpen: true})
}
render () {
return (
<div>
<ModalVideo channel='youtube' isOpen={this.state.isOpen} videoId={this.props.spotlight} onClose={() => this.setState({isOpen: false})} />
<div className="SpotlightButton">
<button onClick={this.openModal}>Open</button>
</div>
</div>
)
}} export default Video