useState vs useRef - team-yaza/mozi-client GitHub Wiki

image

React ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ input์˜ ๊ฐ’์„ ๊ด€๋ฆฌํ•  ๋•Œ useState๋กœ ๊ด€๋ฆฌํ•  ๊ฒƒ์ธ๊ฐ€, useRef๋กœ ๊ด€๋ฆฌํ•  ๊ฒƒ์ธ๊ฐ€์— ๋Œ€ํ•ด ํŒ€์›๊ณผ ํ† ๋ก ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด ๊ธ€์€ ๊ทธ ํ† ๋ก ์— ๊ธฐ๋ฐ˜ํ•ฉ๋‹ˆ๋‹ค.

๋จผ์ €, useState์™€ useRef๋ฅผ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋น„๊ตํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์‹œ์ž‘ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

useState

React์—์„œ ์ปดํฌ๋„ŒํŠธ๋Š” ์ž์‹ ์˜ ์ƒํƒœ ๋˜๋Š” props๊ฐ€ ๋ฐ”๋€Œ๋ฉด ๋ฆฌ๋ Œ๋”๋ง๋ฉ๋‹ˆ๋‹ค. ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด React์—์„œ๋Š” useState๋ฅผ ํ™œ์šฉํ•ฉ๋‹ˆ๋‹ค.

const [state, setState] = useState(initialState);

useState๋Š” ์ƒํƒœ ์œ ์ง€ ๊ฐ’๊ณผ ๊ทธ ๊ฐ’์„ ๊ฐฑ์‹ ํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. setState ํ•จ์ˆ˜๋Š” ์ƒˆ state๋ฅผ ๋ฐ›์•„ ์ปดํฌ๋„ŒํŠธ ๋ฆฌ๋ Œ๋”๋ง ํ์— ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

์ปดํฌ๋„ŒํŠธ๋Š” ๋‹ค์Œ ๋ Œ๋”๋ง ์‹œ์— useState๋ฅผ ํ†ตํ•ด ๋ฐ˜ํ™˜๋ฐ›์€ ์ฒซ๋ฒˆ์งธ ๊ฐ’์€ ํ•ญ์ƒ ๊ฐฑ์‹ ๋œ ์ตœ์‹  state๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.

useRef

Ref๋Š” render ๋ฉ”์„œ๋“œ์—์„œ ์ƒ์„ฑ๋œ DOM ๋…ธ๋“œ๋‚˜ React ์—˜๋ฆฌ๋จผํŠธ์— ์ ‘๊ทผํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

function CustomTextInput(props) {
  // textInput์€ ref ์–ดํŠธ๋ฆฌ๋ทฐํŠธ๋ฅผ ํ†ตํ•ด ์ „๋‹ฌ๋˜๊ธฐ ์œ„ํ•ด์„œ
  // ์ด๊ณณ์—์„œ ์ •์˜๋˜์–ด์•ผ๋งŒ ํ•ฉ๋‹ˆ๋‹ค.
  const textInput = useRef(null);

  function handleClick() {
    textInput.current.focus();
  }

  return (
    <div>
      <input type="text"ref={textInput} />
	  <button onClick={handleClick}>click me</button>
    </div>
  );
}

React ๊ณต์‹ ๋ฌธ์„œ์— ์˜ํ•˜๋ฉด ref์˜ ๋ฐ”๋žŒ์งํ•œ ์‚ฌ์šฉ ์‚ฌ๋ก€๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • ํฌ์ปค์Šค, ํ…์ŠคํŠธ ์„ ํƒ์˜์—ญ, ํ˜น์€ ๋ฏธ๋””์–ด์˜ ์žฌ์ƒ์„ ๊ด€๋ฆฌํ•  ๋•Œ
  • ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ง์ ‘์ ์œผ๋กœ ์‹คํ–‰์‹œํ‚ฌ ๋•Œ
  • ์„œ๋“œ ํŒŒํ‹ฐ DOM ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ React์™€ ๊ฐ™์ด ์‚ฌ์šฉํ•  ๋•Œ

๊ฒฐ๊ตญ React์—์„œ ref๋Š” DOM์„ ์กฐ์ž‘ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ref๋ฅผ ๋‹ค๋ฅธ ์šฉ๋„๋กœ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ์˜ˆ์‹œ๋ฅผ ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

const refContainer = useRef(initialValue);

useRef๋Š” .current ํ”„๋กœํผํ‹ฐ๋กœ ์ „๋‹ฌ๋œ ์ธ์ž(initialValue)๋กœ ์ดˆ๊ธฐํ™”๋œ ๋ณ€๊ฒฝ ๊ฐ€๋Šฅํ•œ ref ๊ฐ์ฒด๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

useRef๋Š” ์ˆœ์ˆ˜ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ useRef๋กœ ๋งŒ๋“  ๊ฐ์ฒด๋ฅผ ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ์€ ์ปดํฌ๋„ŒํŠธ์˜ ๋ Œ๋”๋ง๊ณผ ๋ฌด๊ด€ํ•ฉ๋‹ˆ๋‹ค.
๋‹ค์‹œ ๋งํ•˜๋ฉด, .current ํ”„๋กœํผํ‹ฐ๋ฅผ ๋ณ€ํ˜•ํ•˜๋Š” ๊ฒƒ์ด ๋ฆฌ๋ Œ๋”๋ง์„ ๋ฐœ์ƒ์‹œํ‚ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๋ณธ์งˆ์ ์œผ๋กœ useRef๋Š” .current ํ”„๋กœํผํ‹ฐ์— ๋ณ€๊ฒฝ ๊ฐ€๋Šฅํ•œ ๊ฐ’์„ ๋‹ด๊ณ  ์žˆ๋Š” ์ƒ์ž์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. useRef๋Š” ์ƒ์ž์™€ ๊ฐ™์œผ๋ฏ€๋กœ useState์ฒ˜๋Ÿผ ์ปดํฌ๋„ŒํŠธ ๋‚ด์˜ ๋ณ€์ˆ˜ ๊ฐ’์„ ์กฐํšŒ, ์ˆ˜์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์œ„ ๋‘ ์‚ฌ๋ก€์— ์˜ํ•˜๋ฉด, useRef๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ํŠน์ • DOM์„ ์ง€์ •ํ•˜์—ฌ ํ•ด๋‹น ๋”์˜ ์†์„ฑ๊ฐ’์„ ํŒŒ์•…ํ•˜๊ฑฐ๋‚˜ ์†์„ฑ๊ฐ’์„ ๋ณ€ํ™”์‹œํ‚ค๋Š” ์šฉ๋„๋กœ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๊ณ , ์ˆœ์ˆ˜ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๊ฐ์ฒด๋ฅผ ๋ฐ˜ํ™˜ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ’์„ ์ €์žฅํ•˜๋Š” ์ƒ์ž๋กœ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

useState vs useRef

useState์™€ useRef์˜ ์‚ฌ์šฉ์„ ๋น„๊ตํ•ด๋ณด๋ฉด ๋ Œ๋”๋ง์—์„œ ์ฐจ์ด์ ์„ ๋ณด์ž…๋‹ˆ๋‹ค.

๋จผ์ € useState๋ฅผ ์‚ฌ์šฉํ•ด์„œ input์„ ๋งŒ๋“ค์–ด ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

function Input() {
  const [value, setValue] = useState("")
  return <input value={value} onChange={(e) => setValue(e.target.value)} />
}

export default Input

๋‹น์—ฐํ•˜๊ฒŒ๋„ ์ƒํƒœ๊ฐ€ ๋ฐ”๋€” ๋•Œ๋งˆ๋‹ค ๋ฆฌ๋ Œ๋”๋ง๋˜๋Š” ๋ชจ์Šต์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด์ œ useRef๋ฅผ ์‚ฌ์šฉํ•ด์„œ input ์ปดํฌ๋„ŒํŠธ๋ฅผ ํ…Œ์ŠคํŠธ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

function Input() {
  const inputRef = useRef(null)
  return <input ref={inputRef} />
}

export default Input

์• ์ดˆ์— ์ƒํƒœ๋กœ ๊ด€๋ฆฌํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ ๋ฆฌ๋ Œ๋”๋ง์ด ์ผ์–ด๋‚˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์—ฌ๊ธฐ์„œ ๊ณ ๋ฏผํ–ˆ๋˜ ์ ์€ input ๊ฐ’์„ ๋ณ€๊ฒฝํ•  ๋•Œ ๋ Œ๋”๋ง์ด ํ•„์š”ํ•œ๊ฐ€์— ๋Œ€ํ•œ ๋ถ€๋ถ„์ด์—ˆ์Šต๋‹ˆ๋‹ค.

ํŒ€์›๊ณผ ์ œ ์ƒ๊ฐ์ด ๊ฐ™์•˜๋˜ ๋ถ€๋ถ„์€ input์„ ์ž…๋ ฅํ•˜๋Š” ๊ณผ์ •์—์„œ ๋ Œ๋”๋ง์ด ์ด๋ ‡๊ฒŒ ๋งŽ์ด ์ผ์–ด๋‚˜์•ผํ•˜๋‚˜?๋ผ๋Š” ์ƒ๊ฐ์ด์—ˆ์Šต๋‹ˆ๋‹ค.

๋ฐ˜๋ฉด ํŒ€์›๊ณผ ์ œ ์ƒ๊ฐ์ด ๋‹ฌ๋ž๋˜ ๋ถ€๋ถ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • ์ดํ˜„์ง„: 'input์˜ ์ž…๋ ฅ๊ฐ’ ๋˜ํ•œ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์ƒํƒœ์ด๊ธฐ ๋•Œ๋ฌธ์— useState๋กœ ๊ด€๋ฆฌํ•ด์•ผํ•œ๋‹ค'
  • ํŒ€์›: 'input ์ž…๋ ฅ๊ฐ’์€ ์ƒํƒœ๊ฐ€ ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— useRef๋กœ ๋ฆฌ๋ Œ๋”๋ง์„ ๋ง‰์•„์•ผํ•œ๋‹ค.'

๊ฒฐ๊ตญ input ๊ฐ’์„ ๊ด€๋ฆฌํ•  ๋•Œ useState vs useRef๋ผ๋Š” ์งˆ๋ฌธ์€ React์—์„œ input๊ฐ’์ด ์ƒํƒœ์ธ๊ฐ€๋ผ๋Š” ์งˆ๋ฌธ์œผ๋กœ ๊ท€๊ฒฐ๋ฉ๋‹ˆ๋‹ค.

์ƒ๊ฐ

์ œ ์ƒ๊ฐ์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ƒํƒœ๋ž€ ์ฃผ์–ด์ง„ ์‹œ๊ฐ„์— ๋Œ€ํ•ด ์‹œ์Šคํ…œ์„ ๋‚˜ํƒ€๋‚ด๋Š” ๊ฒƒ์œผ๋กœ ์–ธ์ œ๋“ ์ง€ ๋ณ€๊ฒฝ๋  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅํ•˜๋Š” ๊ฐ’ ๋˜ํ•œ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์ƒํƒœ๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๊ณ , ์‹œ๊ฐ„์˜ ํ๋ฆ„์— ๋”ฐ๋ผ ๋ณ€ํ•˜๋Š” input์˜ ๊ฐ’์€ useState๋กœ ๊ด€๋ฆฌํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.

input์„ state๋กœ ๊ด€๋ฆฌํ•  ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ๋ฆฌ๋ Œ๋”๋ง์— ๋Œ€ํ•œ ๋ถ€๋ถ„์—์„œ๋Š” ๊ณผ์—ฐ ๊ทธ input์„ ๋ฆฌ๋ Œ๋”๋งํ•˜๋Š”๊ฒŒ ๊ณ ๋น„์šฉ ์—ฐ์‚ฐ์ธ๊ฐ€๋ผ๋Š” ์˜๋ฌธ์„ ์ œ๊ธฐํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. input์„ ํƒ€์ดํ•‘ํ•  ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ๋ Œ๋”๋ง์€ ๊ณ ๋น„์šฉ ์—ฐ์‚ฐ์ด ์•„๋‹ˆ๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

๋ฐ˜๋ฉด useRef๋กœ ๋งŒ๋“ค์–ด์ง„ ref๊ฐ์ฒด๋Š” DOM์— ์ ‘๊ทผํ•  ๋•Œ๋‚˜, ๋งค ๋ Œ๋”๋ง์‹œ์— ๋งŒ๋“ค์–ด์ค˜์•ผํ•˜๋Š” ๊ณ ๋น„์šฉ ๊ฐ์ฒด๋‚˜ ๊ฐ’์„ ์ €์žฅํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์˜ณ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

๊ฒฐ๋ก ์€ input์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์‚ฌ์šฉ์ž์˜ ์ƒํ˜ธ์ž‘์šฉ ๋˜ํ•œ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์ƒํƒœ์ด๋ฏ€๋กœ ์ƒํƒœ๋ฅผ ์ƒํƒœ๋‹ต๊ฒŒ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด useState๋ฅผ ์‚ฌ์šฉํ•ด์•ผํ•œ๋‹ค. ์ž…๋‹ˆ๋‹ค.

์—ฌ๋Ÿฌ๋ถ„์€ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”?

22.08.03 ์ถ”๊ฐ€

Controlled/Uncontrolled Components

์ด ๊ธ€์—์„œ ํ–ˆ๋˜ ๊ณ ๋ฏผ์ด ๊ณต์‹๋ฌธ์„œ์— ๋‚˜์™€์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

์šฐ๋ฆฌ์˜ ๊ณ ๋ฏผ์€ ์ด ์ปดํฌ๋„ŒํŠธ๊ฐ€ Controlled Component์ธ๊ฐ€ Uncontrolled Component์ธ๊ฐ€์— ๋Œ€ํ•œ ๊ณ ๋ฏผ์ด์—ˆ์Šต๋‹ˆ๋‹ค.

HTMLElement์ค‘์—๋Š” ์ƒํƒœ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๊ฒƒ๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค.

  • input
  • select
  • textarea

์ด HTMLElement๋“ค์˜ ์ƒํƒœ๋ฅผ ๋ˆ„๊ฐ€ ๊ด€๋ฆฌํ•˜๋Š๋ƒ์— ๋”ฐ๋ผ Controlled Component์™€ Uncontrolled Component๋กœ ๋‚˜๋‰ฉ๋‹ˆ๋‹ค.

์—˜๋ฆฌ๋จผํŠธ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๊ด€๋ฆฌํ•œ๋‹ค๋ฉด, Controlled Component

์—˜๋ฆฌ๋จผํŠธ์˜ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•˜์ง€ ์•Š๊ณ  ์—˜๋ฆฌ๋จผํŠธ์˜ ์ฐธ์กฐ๋งŒ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์†Œ์œ ํ•œ๋‹ค๋ฉด, Uncontrolled Component์ž…๋‹ˆ๋‹ค.

์ฆ‰, ์‰ฝ๊ฒŒ ๋งํ•˜๋ฉด useState์— ์˜ํ•ด ์ƒํƒœ๋กœ ๊ด€๋ฆฌํ•˜๊ณ  ์žˆ๋Š” ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ œ์–ด ์ปดํฌ๋„ŒํŠธ๋ผ๊ณ  ํ•˜๊ณ , React๊ฐ€ ์ƒํƒœ๋กœ ์ถ”์ ํ•˜๊ณ  ์žˆ์ง€ ์•Š์€ ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋น„์ œ์–ด ์ปดํฌ๋„ŒํŠธ๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋น„์ œ์–ด ์ปดํฌ๋„ŒํŠธ๊ฐ™์€ ๊ฒฝ์šฐ ref๋ฅผ ํ™œ์šฉํ•ด ์‹ค์ œ DOM์— ์ ‘๊ทผํ•ฉ๋‹ˆ๋‹ค. ๋น„์ œ์–ด ์ปดํฌ๋„ŒํŠธ๋Š” DOM์ž์ฒด์—์„œ ๋ฐ์ดํ„ฐ๊ฐ€ ๋‹ค๋ค„์ง‘๋‹ˆ๋‹ค.

์•„๋ž˜๋Š” ๊ณต์‹๋ฌธ์„œ์—์„œ ์ธ์šฉํ•œ ๋ฌธ์žฅ์ž…๋‹ˆ๋‹ค.

In a controlled component, form data is handled by a React component. The alternative is uncontrolled components, where form data is handled by the DOM itself.

(๋ฒˆ์—ญ) ๋Œ€๋ถ€๋ถ„ ๊ฒฝ์šฐ์— ํผ์„ ๊ตฌํ˜„ํ•˜๋Š”๋ฐ ์ œ์–ด ์ปดํฌ๋„ŒํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ์ œ์–ด ์ปดํฌ๋„ŒํŠธ์—์„œ ํผ ๋ฐ์ดํ„ฐ๋Š” React ์ปดํฌ๋„ŒํŠธ์—์„œ ๋‹ค๋ฃจ์–ด์ง‘๋‹ˆ๋‹ค. ๋Œ€์•ˆ์ธ ๋น„์ œ์–ด ์ปดํฌ๋„ŒํŠธ๋Š” DOM ์ž์ฒด์—์„œ ํผ ๋ฐ์ดํ„ฐ๊ฐ€ ๋‹ค๋ฃจ์–ด์ง‘๋‹ˆ๋‹ค.

form์˜ input ์ƒํƒœ๊ฐ™์€ ๊ฒฝ์šฐ React๊ฐ€ ์ถ”์ ํ•ด์„œ ๊ทธ ๊ฐ’์œผ๋กœ ์–ด๋–ค ํ–‰๋™์„ ํ•  ์—ฌ์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด์„œ ๋กœ๊ทธ์ธ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ๋กœ์ง์ด state๊ฐ€ ๋ณ€ํ•จ์— ๋”ฐ๋ผ ์‹คํ–‰๋˜์–ด์•ผํ•˜๋ฉด ์ œ์–ด ์ปดํฌ๋„ŒํŠธ๋ฅผ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ฐ˜๋ฉด์—, ๋น„์ œ์–ด ์ปดํฌ๋„ŒํŠธ๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ์‹ค์ œ DOM์„ ์ฐธ์กฐํ•ด์•ผํ•˜๋Š” ๊ฒฝ์šฐ์— ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ€์žฅ ํ”ํ•œ ๊ฒฝ์šฐ๋กœ input์— focus๋ฅผ ํ•˜๋Š” ์ƒํ™ฉ์„ ์˜ˆ๋กœ ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ, ์‹ค์ œ DOM์— ์ ‘๊ทผํ•ด์•ผํ•˜๋Š” ์ƒํ™ฉ์ด ์•„๋‹ˆ๋ผ๋ฉด React ์ปดํฌ๋„ŒํŠธ๊ฐ€ input์˜ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.(์ œ์–ด ์ปดํฌ๋„ŒํŠธ)

๋” ์ฝ์„๊ฑฐ๋ฆฌ

โš ๏ธ **GitHub.com Fallback** โš ๏ธ