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

全局主题配置中深色模式无法对 message 和部分 Modal 生效 #39570

Closed
allynlin opened this issue Dec 15, 2022 · 2 comments
Closed

Comments

@allynlin
Copy link

Reproduction link

https://github.com/allynlin/antd-demo

Steps to reproduce

  1. 点击按钮展示出三个提示,分别是 message 和两个 Modal
  2. 这三个中只有一个 Modal 可以正确应用深色模式,还有一个 Modal 和 message 仍旧是浅色模式

What is expected?

三个都是深色模式

What is actually happening?

一个深色模式,两个浅色模式

Environment Info
antd 5.0.7
React 18.2.0
System Windows 11 家庭版 Insider Preview 22H2 25262.1000
Browser Microsoft Edge 108.0.1462.46
@MadCcc
Copy link
Member

MadCcc commented Dec 15, 2022

V5 中静态方法直接使用不跟随主题。推荐使用 hooks 版本或者在后续的 5.1.0 版本中使用 App 组件。Ref: #38901

当前版本的兼容方案:https://github.com/ant-design/ant-design/blob/feature/components/app/index.zh-CN.md#%E5%85%A8%E5%B1%80%E5%9C%BA%E6%99%AFredux-%E5%9C%BA%E6%99%AF

@MadCcc MadCcc closed this as completed Dec 15, 2022
@Wxh16144
Copy link
Member

这个不是一个 bug, 具体文档中有说明 为什么 Modal 方法不能获取 context、redux、的内容和 ConfigProvider locale/prefixCls/theme 等配置?, 官方已经在处理这个了, 可以关注一下 #39046

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

3 participants