Browse Source

use .componentDidUpdate in SliderBase

Alexander Rose 5 năm trước cách đây
mục cha
commit
01cca9e8a6
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/mol-plugin/ui/controls/slider.tsx

+ 1 - 1
src/mol-plugin/ui/controls/slider.tsx

@@ -320,7 +320,7 @@ export class SliderBase extends React.Component<SliderBaseProps, SliderBaseState
     private startValue = 0;
     private _getPointsCache: any = void 0;
 
-    componentWillReceiveProps(nextProps: SliderBaseProps) {
+    componentDidUpdate(nextProps: SliderBaseProps) {
         if (!('value' in nextProps || 'min' in nextProps || 'max' in nextProps)) return;
 
         const { bounds } = this.state;