์„œ๋ฒ„ ์ปดํฌ๋„ŒํŠธ์˜ ํด๋ผ์ด์–ธํŠธ ๋กœ์ง ๋ถ„๋ฆฌํ•˜๊ธฐ

์„œ๋ฒ„ ์ปดํฌ๋„ŒํŠธ์˜ ํด๋ผ์ด์–ธํŠธ ๋กœ์ง ๋ถ„๋ฆฌํ•˜๊ธฐ

React.cloneElement API๋ฅผ ํ™œ์šฉํ•ด ํด๋ผ์ด์–ธํŠธ ๋กœ์ง์„ ์„œ๋ฒ„ ์ปดํฌ๋„ŒํŠธ๋กœ๋ถ€ํ„ฐ ๋ถ„๋ฆฌํ•œ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ๋‹ค๋ฃฌ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค.

  • rsc
  • cloneElement
  • asChild
  • callbackRef
๋ธ”๋กœ๊ทธ Pages Router โ†’ App Router ์ „ํ™˜๊ธฐ 2ํŽธ [NextJS]

๋ธ”๋กœ๊ทธ Pages Router โ†’ App Router ์ „ํ™˜๊ธฐ 2ํŽธ [NextJS]

NextJS v12์˜ Page Router ๋ฐฉ์‹์œผ๋กœ ๊ฐœ๋ฐœ๋œ ๊ฐœ์ธ๋ธ”๋กœ๊ทธ๋ฅผ NextJS v13(14)์˜ AppRouter๋กœ ์ „ํ™˜ํ•˜๋ฉด์„œ ์žˆ์—ˆ๋˜ ๊ณผ์ •์— ๋Œ€ํ•ด ์ •๋ฆฌํ•œ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค.

  • nextjs
  • rsc
๋ธ”๋กœ๊ทธ Pages Router โ†’ App Router ์ „ํ™˜๊ธฐ 1ํŽธ [NextJS]

๋ธ”๋กœ๊ทธ Pages Router โ†’ App Router ์ „ํ™˜๊ธฐ 1ํŽธ [NextJS]

NextJS v12์˜ Page Router ๋ฐฉ์‹์œผ๋กœ ๊ฐœ๋ฐœ๋œ ๊ฐœ์ธ๋ธ”๋กœ๊ทธ๋ฅผ NextJS v13(14)์˜ AppRouter๋กœ ์ „ํ™˜ํ•˜๋ฉด์„œ ์žˆ์—ˆ๋˜ ๊ณผ์ •์— ๋Œ€ํ•ด ์ •๋ฆฌํ•œ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค.

  • nextjs
  • rsc