-
-
Notifications
You must be signed in to change notification settings - Fork 11
fix:react 17 报错问题 (#216) #217
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/398188662/react-code-preview/AhzoDJ5YdAcLkEek79DaKqL47a3p |
package.json
Outdated
"@uiw/react-github-corners": "~1.5.14", | ||
"@uiw/react-markdown-preview": "~4.0.6", | ||
"@uiw/react-github-corners": "~1.5.3", | ||
"@uiw/react-markdown-preview": "~3.5.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SunLxy 在 "@uiw/react-markdown-preview": "~4.0.6"
报错?
// 判断是否是 react v18版本 | ||
const isV18 = Reflect.has(V18ReactDOM || {}, 'createRoot'); | ||
const isV18 = Reflect.has(V18ReactDOM, 'createRoot'); | ||
const NewReactDOM = isV18 ? ReactDOMRender(V18ReactDOM) : V18ReactDOM; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SunLxy 处理方法仍然有问题,我们的代码放到 codepen 和 codesandbox 中是可以预览的
@SunLxy 文档中的示例处理一下。 |
https://codesandbox.io/s/uiw-react-code-preview-react-18-1bmhhd?from-embed=&file=/src/App.js 在 React 18 下面报警告。 @SunLxy
|
umd 中报警告的等着修复吧 facebook/react#24274 |
@SunLxy 👍 |
Module not found:Error: Can't resolve 'react-dom/client'
这个报错,可以忽略