I\'m new to ReactJS (0.13.1), and I\'ve created a component in my app to display HTML5 video.
It seems to work perfectly but only for the first selection. The vid
Try this way
import React, { Component } from "react";
class Video extends Component {
video: any = React.createRef();
componentDidUpdate(preProps: any) {
const { url } = this.props;
if (preProps && preProps.url && url) {
if (preProps.url !== url) {
this.video.current.src = url;
}
}
}
render() {
const { url } = this.props;
return (
);
}
}