|
@@ -99,11 +99,6 @@ const WbwDetailFmWidget = ({
|
|
|
const [factorInputEnable, setFactorInputEnable] = useState(false);
|
|
const [factorInputEnable, setFactorInputEnable] = useState(false);
|
|
|
const [factorMeaning, setFactorMeaning] = useState<string[]>(initValue);
|
|
const [factorMeaning, setFactorMeaning] = useState<string[]>(initValue);
|
|
|
|
|
|
|
|
- useEffect(() => {
|
|
|
|
|
- console.log("value", initValue);
|
|
|
|
|
- setFactorMeaning(initValue);
|
|
|
|
|
- }, [initValue]);
|
|
|
|
|
-
|
|
|
|
|
const resizeArray = (input: string[]) => {
|
|
const resizeArray = (input: string[]) => {
|
|
|
const newFm = factors.map((item, index) => {
|
|
const newFm = factors.map((item, index) => {
|
|
|
if (index < input.length) {
|
|
if (index < input.length) {
|
|
@@ -115,6 +110,11 @@ const WbwDetailFmWidget = ({
|
|
|
return newFm;
|
|
return newFm;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ console.log("value", initValue);
|
|
|
|
|
+ setFactorMeaning(resizeArray(initValue));
|
|
|
|
|
+ }, []);
|
|
|
|
|
+
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
setFactorMeaning(resizeArray(factorMeaning));
|
|
setFactorMeaning(resizeArray(factorMeaning));
|
|
|
}, [factors]);
|
|
}, [factors]);
|