5
`useRef`와`createRef`의 차이점은 무엇입니까?
나는 우연히 발견했을 때 후크 문서를 살펴보고 있었다 useRef. 그들의 예를 보면… function TextInputWithFocusButton() { const inputEl = useRef(null); const onButtonClick = () => { // `current` points to the mounted text input element inputEl.current.focus(); }; return ( <> <input ref={inputEl} type="text" /> <button onClick={onButtonClick}>Focus the input</button> </> ); } …