main.ts报错问题

Argument of type 'HTMLElement | null' is not assignable to parameter of type 'Element | DocumentFragment'. Type 'null' is not assignable to type 'Element | DocumentFragment'.ts(2345)
在这里插入图片描述
改正后

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_47287832/article/details/128502299