-
Notifications
You must be signed in to change notification settings - Fork 23
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
umi4 的max 通过useModel 获取全局初始状态报错 #76
Comments
同样的问题描述:
操作:$ mkdir myapp && cd myapp
重现: |
在 src/app.ts 中增加以下代码试试 import { autoFixContext } from 'react-activation';
import jsxRuntime from 'react/jsx-runtime'
import jsxDevRuntime from 'react/jsx-dev-runtime'
autoFixContext(
[jsxRuntime, 'jsx', 'jsxs', 'jsxDEV'],
[jsxDevRuntime, 'jsx', 'jsxs', 'jsxDEV']
) |
我是这么加在 src/app.tsx 中的,但是不起作用,仍旧报上述错误,@umijs/max版本:4.0.73 |
没有app.ts就新建一个 亲测有效 umi.js |
这个可以解决umi里用到的Context跟外层包的Context 报错的问题 |
使用keepAlive 包裹组件后,在组件内部获取全局初始状态报错 const { initialState } = useModel('@@initialstate');
The text was updated successfully, but these errors were encountered: