Skip to content
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

有没有大佬遇到过再加入KeepAlive后,antd的ConfigProvider设置中文失效的问题 #291

Open
xiaomengheiheihei opened this issue Oct 16, 2023 · 4 comments

Comments

@xiaomengheiheihei
Copy link

我从项目入口分了两个版本出来,第一个版本没有缓存,第二个版本加入keeper,其他并内有什么区别,再加入keepalive后发现中文设置失效了,有没有大佬有过类似的问题,求教~

@CJY0208
Copy link
Owner

CJY0208 commented Oct 17, 2023

上下文问题,检查一下 react 的版本,如果是 17 或者 18,项目入口处加这一句试试

import { autoFixContext } from 'react-activation'

autoFixContext(
  [require('react/jsx-runtime'), 'jsx', 'jsxs', 'jsxDEV'],
  [require('react/jsx-dev-runtime'), 'jsx', 'jsxs', 'jsxDEV']
)

@xiaomengheiheihei
Copy link
Author

react版本是16,
"react": "16.4.1",
"react-dom": "16.4.0",
而且这个require('react/jsx-runtime')会报错

@CJY0208
Copy link
Owner

CJY0208 commented Oct 27, 2023

16 的话应该不会有这个问题,能否提供一个复现用例呀

@xiaomengheiheihei
Copy link
Author

好,我尽量搞一个demo复现一下,但是项目比较老也比较复杂,辛苦大大先帮忙看下截图是否能看出一些问题,我怀疑可能和redux有些关系
这里是应用入口,做了判断
image
这里是加了keeper的app组件
image
这里是路由的包装组件
image

目前我在尝试将redux去掉看看是否可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants