Selaa lähdekoodia

ref(large-video): use componentDidUpdate to change background image

j8
Leonard Kim 7 vuotta sitten
vanhempi
commit
85f487cca5

+ 4
- 6
react/features/large-video/components/LargeVideoBackground.web.js Näytä tiedosto

@@ -117,17 +117,15 @@ export class LargeVideoBackground extends Component<Props> {
117 117
      * Starts or stops the interval to update the image displayed in the canvas.
118 118
      *
119 119
      * @inheritdoc
120
-     * @param {Object} nextProps - The read-only React {@code Component} props
121
-     * with which the new instance is to be initialized.
122 120
      */
123
-    componentWillReceiveProps(nextProps: Props) {
124
-        if (this.props.hidden && !nextProps.hidden) {
121
+    componentDidUpdate(prevProps: Props) {
122
+        if (prevProps.hidden && !this.props.hidden) {
125 123
             this._clearCanvas();
126 124
             this._setUpdateCanvasInterval();
127 125
         }
128 126
 
129
-        if ((!this.props.hidden && nextProps.hidden)
130
-            || !nextProps.videoElement) {
127
+        if ((!prevProps.hidden && this.props.hidden)
128
+            || !this.props.videoElement) {
131 129
             this._clearCanvas();
132 130
             this._clearUpdateCanvasInterval();
133 131
         }

Loading…
Peruuta
Tallenna