Render Props ํŒจํ„ด์„ ํ™œ์šฉํ•ด ๋กœ์ง ๋ถ„๋ฆฌํ•˜๊ธฐ

Render Props ํŒจํ„ด์„ ํ™œ์šฉํ•ด ๋กœ์ง ๋ถ„๋ฆฌํ•˜๊ธฐ

render props ํŒจํ„ด์„ ํ™œ์šฉํ•ด ํ™˜๊ฒฝ๋ณ„ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง๊ณผ ๋ Œ๋”๋ง ๋กœ์ง์„ ๋ถ„๋ฆฌํ•ด ์ฝ”๋“œ์˜ ๊ฐ€๋…์„ฑ์„ ๋†’์ธ ๊ฒฝํ—˜์— ๋Œ€ํ•ด ์ž‘์„ฑํ•œ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค.

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

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

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
๋ฐ์ดํ„ฐ ๊ตฌ์กฐ์— ์œ ์—ฐํ•˜๋„๋ก Form ์ปดํฌ๋„ŒํŠธ ๊ฐœ์„ ํ•˜๊ธฐ

๋ฐ์ดํ„ฐ ๊ตฌ์กฐ์— ์œ ์—ฐํ•˜๋„๋ก Form ์ปดํฌ๋„ŒํŠธ ๊ฐœ์„ ํ•˜๊ธฐ

๋ฐ์ดํ„ฐ์™€ ํƒ€์ž…์— ๊ฐ•ํ•˜๊ฒŒ ๊ฒฐํ•ฉ๋˜์–ด ์žˆ๋˜ Form ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋ณ€ํ™”์— ์œ ์—ฐํ•˜๋„๋ก ๊ฐœ์„ ํ•œ ๋‚ด์šฉ์„ ๋‹ค๋ฃฌ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค.

  • context
  • react-hook-form
๐Ÿ‘ป Jotai ๋™์ž‘์›๋ฆฌ ํŒŒํ—ค์น˜๊ธฐ(2)

๐Ÿ‘ป Jotai ๋™์ž‘์›๋ฆฌ ํŒŒํ—ค์น˜๊ธฐ(2)

์ƒํƒœ๊ด€๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ Jotai์˜ ๋‚ด๋ถ€ ๋™์ž‘์›๋ฆฌ๋ฅผ ๋ถ„์„ํ•œ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค. ์ด ํฌ์ŠคํŠธ์—์„œ๋Š” Store์™€ ๊ด€๋ จ๋œ ๋™์ž‘์— ๋Œ€ํ•ด์„œ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

  • jotai
  • ์ƒํƒœ๊ด€๋ฆฌ
๐Ÿ‘ป Jotai ๋™์ž‘์›๋ฆฌ ํŒŒํ—ค์น˜๊ธฐ(1)

๐Ÿ‘ป Jotai ๋™์ž‘์›๋ฆฌ ํŒŒํ—ค์น˜๊ธฐ(1)

์ƒํƒœ๊ด€๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ Jotai์˜ ๋‚ด๋ถ€ ๋™์ž‘์›๋ฆฌ์™€ ์†Œ์Šค์ฝ”๋“œ๋ฅผ ๋ถ„์„ํ•œ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค. ํ•ด๋‹น ํฌ์ŠคํŠธ์—์„œ๋Š” ๊ธฐ๋ณธ์ด ๋˜๋Š” atom๊ณผ Provider์— ๋Œ€ํ•ด์„œ ๋‹ค๋ฃน๋‹ˆ๋‹ค

  • jotai
  • ์ƒํƒœ๊ด€๋ฆฌ
NextJS ํ”„๋กœ์ ํŠธ์—์„œ QueryString ๊ฒ€์ฆํ•˜๊ธฐ

NextJS ํ”„๋กœ์ ํŠธ์—์„œ QueryString ๊ฒ€์ฆํ•˜๊ธฐ

ServerSide์™€ ClientSide์—์„œ QueryString์„ ๊ฒ€์ฆํ•˜๋Š” ์—ฌ๋Ÿฌ ํŒจํ„ด๊ณผ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ๋‹ค๋ฃฌ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค.

  • nextjs
  • hoc
  • custom hooks