๐Ÿ“šย Reference


๐Ÿ“œ Chapter


useState

Class component

Function component

useImperativeHandle

โ€ฃ

useRef


const ref = useRef(value)
//ref Object
{current: value}

// ์˜ˆ์‹œ
const ref = useRef("hi")
{current: "hi"}

const ref = useRef("hello")
{current: "hello"}

const ref = useRef("nice")
{current: "nice"}

useRef - ์‚ฌ์šฉ, ์šฉ๋„


  1. state์™€ ๋น„์Šทํ•˜๊ฒŒ ๊ฐ’์„ ์ €์žฅํ•˜๋Š” ๊ณต๊ฐ„์ด๋‹ค.
  1. DOM ์š”์†Œ์— ์ ‘๊ทผ