当我运行.tsx文件时,我会得到这个错误
类型错误
消息dispatcher.useInsertionEffect不是函数
堆栈跟踪TypeError:dispatcher.useInsertionEffect不是函数正在使用InsertionEffect(webpack-internal:///../../node_modules/react/cjs/react.development.js:1639:21)插入时(webpack-internal:///../../node_modules/@情绪/风格/基础/dist/情绪风格的基础.浏览器.esm.js:54:133(在renderWithHooks(webpack-internal:///../../node_modules/@热加载器/rect-dom-v17/cjs/rect-dom.development.js:14986:18(在mountIndeterminateComponent(webpack-internal:///../../node_modules/@热加载器/rect-dom-v17/cjs/rect-dom.development.js:17812:13(at beginWork(webpack-internal:///../../node_modules/@热加载程序/rect-dom-v17/cjs/rect-dom.development.js:19050:16(位于HTMLUnknownElement.callCallback(webpack-internal:///../../node_modules/@热加载器/rect-dom-v17/cjs/rect-dom.development.js:3946:14(位于Object.invokeGuardedCallbackDev(webpack-internal:///../../node_modules/@热加载器/rect-dom-v17/cjs/rect-dom.development.js:3995:16(在invokeGuardedCallback(webpack-internal:///../../node_modules/@热加载器/rect-dom-v17/cjs/rect-dom.development.js:4057:31(开始工作$1(webpack-internal:///../../node_modules/@热加载器/rect-dom-v17/cjs/rect-dom.development.js:23960:7(在performUnitOfWork(webpack-internal:///../../node_modules/@热加载器/rect-dom-v17/cjs/rect-dom.development.js:222775:12(
它运行得很好,但突然开始出问题。实际上无法解决问题。如有任何帮助,我们将不胜感激。
useInsertionEffect
是React 18的一个功能,您可能依赖于比存储库中的版本更旧的版本。不过,我们正式只支持^16.13.1
和^17
——您可能需要检查您的依赖关系,以免无意中引入React 18功能。