Contents

Context Provider์— ๋Œ€ํ•˜์—ฌ

   Jun 11, 2023     0 min read

Context Provider์— ๋Œ€ํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค.

Provider๋Š” ์ •์˜ํ•œ context๋ฅผ ํ•˜์œ„ ์ปดํฌ๋„ŒํŠธ์—๊ฒŒ ์ „๋‹ฌํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ์ค‘์ฒฉํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ณ , ์ค‘์ฒฉํ•  ๊ฒฝ์šฐ ํ•˜์œ„ provider ๊ฐ’์ด ์šฐ์„ ์‹œ ๋ฉ๋‹ˆ๋‹ค. provider์˜ value state๊ฐ€ ๋ณ€ํ™”ํ•  ๋•Œ๋งˆ๋‹ค components๋Š” ์ „๋ถ€ rerender๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.

  • Context๋ž€ ๋ฌด์—‡์ธ๊ฐ€
    • ์–ด๋–ค ๊ฐ์ฒด๋ฅผ ํ•ธ๋“ค๋งํ•˜๊ธฐ ์œ„ํ•œ ์ ‘๊ทผ ์ˆ˜๋‹จ