Legacy React APIs

์ด API๋Š” react ํŒจํ‚ค์ง€์—์„œ ์ถ”์ถœํ–ˆ์ง€๋งŒ ์ƒˆ๋กœ ์ž‘์„ฑํ•  ์ฝ”๋“œ์—์„œ ์‚ฌ์šฉ์„ ์ถ”์ฒœํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋งํฌ๋ฅผ ํ†ตํ•ด ๊ฐ๊ฐ์˜ API ํŽ˜์ด์ง€์—์„œ ์ œ์‹œํ•œ ๋Œ€์•ˆ์„ ํ™•์ธํ•ด์ฃผ์„ธ์š”.


Legacy APIs

  • Children์€ children prop์œผ๋กœ ๋ฐ›์€ JSX๋ฅผ ์กฐ์ž‘ํ•˜๊ณ  ๋ณ€ํ˜•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋Œ€์•ˆ ํ™•์ธํ•˜๊ธฐ
  • cloneElement๋ฅผ ํ†ตํ•ด ๋‹ค๋ฅธ ์—˜๋ฆฌ๋จผํŠธ๋ฅผ ์‹œ์ž‘์ ์œผ๋กœ ์‚ฌ์šฉํ•˜์—ฌ React ์—˜๋ฆฌ๋จผํŠธ๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋Œ€์•ˆ ํ™•์ธํ•˜๊ธฐ
  • Component๋Š” Javascript Class๋กœ์จ React ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ๋Œ€์•ˆ ํ™•์ธํ•˜๊ธฐ
  • createElement๋กœ React ์—˜๋ฆฌ๋จผํŠธ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ JSX๋ฅผ ๋Œ€์‹  ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • createRef๋Š” ์ž„์˜์˜ ๊ฐ’์„ ํฌํ•จํ•  ์ˆ˜ ์žˆ๋Š” ์ฐธ์กฐ ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ๋Œ€์•ˆ ํ™•์ธํ•˜๊ธฐ
  • isValidElement๋Š” ๊ฐ’์˜ React ์—˜๋ฆฌ๋จผํŠธ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ cloneElement์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • PureComponent๋Š” Component์™€ ์œ ์‚ฌํ•˜์ง€๋งŒ, ๋™์ผํ•œ props์˜ ์žฌ๋ Œ๋”๋Š” ์ƒ๋žตํ•ฉ๋‹ˆ๋‹ค. ๋Œ€์•ˆ ํ™•์ธํ•˜๊ธฐ

Deprecated APIs

Deprecated

์ด API๋Š” ์ถ”ํ›„ React major ๋ฒ„์ „์—์„œ ์ œ๊ฑฐ๋  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

  • createFactory๋Š” ํŠน์ • ์œ ํ˜•์˜ React ์—˜๋ฆฌ๋จผํŠธ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.