Binding element 'children' implicitly has an 'any' type

Daisy๐ŸŒผยท2022๋…„ 9์›” 12์ผ
3

๐Ÿ“Œ ๋ฌธ์ œ ์ƒํ™ฉ

๋ฆฌ์•กํŠธ์—์„œ typescript๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๋ฐ children๊ณผ ๊ด€๋ จ๋œ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ†˜ Binding element 'children' implicitly has an 'any' type.

๐Ÿ“Œ ํ•ด๊ฒฐ ๊ณผ์ •

์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ๊ทธ๋Œ€๋กœ ๊ฒ€์ƒ‰ํ–ˆ๊ณ , ๊ด€๋ จ ์งˆ๋ฌธ์„ stackoverflow์—์„œ ์ฐพ์„ ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์ถœ์ฒ˜

๊ฐ€์žฅ ๋งŽ์€ ์ถ”์ฒœ์„ ๋ฐ›์€ ๋‹ต๋ณ€์„ ํ•ด์„ํ•ด๋ณด๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

React 18๋ฒ„์ „์—์„œ FC(Functional Component)๋Š” ๋”์ด์ƒ children์„ ์ œ๊ณตํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ง์ ‘ children์˜ ํƒ€์ž…์„ ์ง€์ •ํ•˜๊ณ  FC์— ์ „๋‹ฌํ•ด์ฃผ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ“Œ ๋ฌธ์ œ ํ•ด๊ฒฐ

๋‹ต๋ณ€์— ๋‚˜์™€์žˆ๋Š” ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ฒ˜๋Ÿผ, ์ง์ ‘ children์˜ ํƒ€์ž…์„ ์ง€์ •ํ•ด์ฃผ์—ˆ๋”๋‹ˆ ์—๋Ÿฌ๊ฐ€ ์‚ฌ๋ผ์กŒ์Šต๋‹ˆ๋‹ค. (์‹ค์Šต์„ ์œ„ํ•ด ์•„์ฃผ ๊ฐ„๋‹จํ•œ ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋งŒ๋“ค์–ด๋ดค์Šต๋‹ˆ๋‹ค.)

profile
์ปคํ”ผ์™€ ์žฌ์ฆˆ๋ฅผ ์ข‹์•„ํ•˜๋Š” ์ฝ”๋ฆฐ์ด | ์ข‹์€ ๊ธ€ ์ข‹์€ ์ฝ”๋“œ๋ฅผ ์“ฐ๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค

0๊ฐœ์˜ ๋Œ“๊ธ€