천재의 form 관리법 리액트에셔 form(input)을 관리하는 방법은 2가지가 있다제어 컴포넌트 사용비제어 컴포넌트 사용제어 컴포넌트(controlled component)제어 컴포넌트는 리액트에 의해 값이 관리되는 방식을 말한다쉽게 말하자면 리액트의 useState를 사용해 input을 관리하는것을 말한다!const ControlledComponent = () => { const [inputValue, setInputValue] = useState(""); return ( setInputValue(e.target.value)} /> );};위의 코드는 inputValue라는 state를 만들어 input을 제어하고있다비제어 컴포넌트(Uncontrolled component)비제어 컴포넌트는 리액트에 의해.. 이전 1 다음