-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
ConfigProvider组件在nextjs13.4 app目录项目中能像antd-design一样,提供类似AntdRegistry.tsx来支持ssr配置多语言嘛 #6423
Comments
感觉可以加一个 |
现有方案上,有啥好思路可以不升级解决嘛~ |
这个是我的解决方案,在next项目中,创建configProvider.tsx,然后将组件挂载到layout.tsx中,参考的是next官网给的例子:https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#using-context-providers //ts interface AntdLngConfigProps { export const mobileConfigContext = createContext(); |
你好,问一下你这个是完整的吗,我反复试了一下没有效果,想请教一下有没有最小实现的代码参考一下 |
是完整的,都已经运用在生产环境了,我的代码是公司内部,不方便粘贴一个demo出来,整个就是一个configProvider.tsx,具体是跟antd的一模一样的,使用你可以参考这里https://ant.design/docs/react/use-with-next-cn 里面有一个App router对应的 |
方便的话,你可以把你的demo贴出来下,我可以抽空帮你看看 |
@loakliu 可以了,感谢兄弟相助!! |
Version of antd-mobile
5.33
Operating system and its version
Others
Browser and its version
No response
Sandbox to reproduce
No response
What happened?
我在next.js 中像antd-design一样配置ConfigProvider组件,但却提示必须要添加‘use client’
能否像antd-design一样,支持让ConfigProvider组件可以不需要添加‘use client’
https://ant-design.antgroup.com/docs/react/use-with-next-cn
下面是报错信息:
Relevant log output
No response
The text was updated successfully, but these errors were encountered: