Input + Output = True

React index.tsx ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์—๋Ÿฌ ๋ณธ๋ฌธ

๐ŸŽจFrontEnd/typescript

React index.tsx ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์—๋Ÿฌ

IOTrue 2023. 4. 1. 22:44

React typescript root Error

argument of type 'htmlelement | null' is not assignable 
to parameter of type 'element | documentfragment'

 

์…€๋ ‰ํ„ฐ์˜ ํƒ€์ž…์„ ์ง€์ •ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.

index.tsx์—์„œ๋Š” document.getElementById('root')

 

1. ์—๋Ÿฌ : document.getElementById('root') 

 

2. ํ•ด๊ฒฐ : document.getElementById('root') as HTMLElement

 

 

 

Comments