-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React18版本需要提示更新 #234
Comments
// Before
import { render } from 'react-dom';
const container = document.getElementById('app');
render(<App tab="home" />, container);
// After
import { createRoot } from 'react-dom/client';
const container = document.getElementById('app');
const root = createRoot(container); // createRoot(container!) if you use TypeScript
root.render(<App tab="home" />); @ZYyyh-cool 错误在于你 18 的 API使用 |
@jaywcjlove 18 API使用没用问题,可以看看上面使用情况代码,注释掉Map组件没有报错,我再排查下 |
我也测试了你的实例,也是没有问题 |
@ZYyyh-cool import { createRoot } from 'react-dom/client'; |
尝试在Map组件里面添加Marker会报错,不确实是否能这样用,我看你们的官网网站是这样用的 |
我换这种用法就没有报错了 |
还有之前提到的类型不兼容的问题: #233 |
import { Map,Marker} from '@uiw/react-amap';
使用Map就会提示
Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more
希望能更新下React18版本
使用情况:
The text was updated successfully, but these errors were encountered: