У меня есть следующий код:
import Vimeo from '@vimeo/player';
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.videoRef= React.createRef();
}
componentDidMount() {
const player = new Vimeo(this.videoRef);
}
render() {
return (
<item><iframe ref={this.videoRef} /></item>
)
}
}
Однако я получаю за new Vimeo(this.videoRef)
и ошибку
Unhandled Rejection (TypeError): You must pass either a valid element or a valid id.
Что не так?