瀏覽代碼

Allow to set the value from the outside

Popov72 5 年之前
父節點
當前提交
ecb4fc08ad
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      nodeEditor/src/sharedComponents/optionsLineComponent.tsx

+ 4 - 0
nodeEditor/src/sharedComponents/optionsLineComponent.tsx

@@ -38,6 +38,10 @@ export class OptionsLineComponent extends React.Component<IOptionsLineComponentP
         this.state = { value: this._getValue(props) };
     }
 
+    setValue(value: string | number) {
+        this.setState({ value: value });
+    }
+
     shouldComponentUpdate(nextProps: IOptionsLineComponentProps, nextState: { value: number }) {
         if (this._localChange) {
             this._localChange = false;