9/23
여러 옵션이 추가적으로 늘어난다
이것들의 데이터가 추가된다
순서대로 추가될시 왓다갓다하며 적었을때 순서가 섞일 수 가 있다.
각자 고유 배열의 값에 데이터가 들어가야만 한다
그렇다면 하나의 세트로 들어가는 것이 좋지안을까?
그냥 첫째 배열 - 몇번째 2째 이름인지 뭔지 넣고했다
tempdimenstion: {
[action.dimension1]: { [action.dimension2]: action.optionName },
},
...state,
tempdimension: state.tempdimension.concat({
[action.dimension1]: { [action.dimension2]: action.optionName },
}),
};
이건 오류가 없고
...state,
tempdimension: {
[action.dimension1]: { [action.dimension2]: state.tempdimension.concat(action.optionName }),
},
};
이건 오류가 난다
tempdimension: state.tempdimension[action.dimenstion1].splice(action.dimension2, 1, action.optionName),
splice는 만약 뒤에것부터 채워진다고 가정하면 eX)이름을 지워야하는데 가격ㅇㄹ 지워버릴수 있다.답이벗어지므로 패스
그냥 갈아엎는게 빠를것 같아 갈아엎기로 결정
warning: A component is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component
새로 이름넣기 설명 넣기를 했는데 이러한 에러가 떳다
const [newInputExplain, setNewInputExplain] = useState('');
문제가 또 생겼다...
A component is changing an uncontrolled input of type text to be controlled error in ReactJS
Warning: A component is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a contro...
stackoverflow.com
관련 해결 링크