Open miadwang opened 2 years ago
使用configProvider配置popupContainer为root节点,节点所在位置有react-intl提供的context,但是组件无法获取到。
错误为:Error: [React Intl] Could not find required intl
object.
FormattedMessage代码
Antd的message和dialog组件提供一种配置方法获取context https://ant.design/components/modal-cn/
比较像 ConfigProvider 的问题
问题同 Antd 的原因一样,创建了新的 react 树来承载弹层内容,所以获取不到应用树的 context,需要新增类似 Antd 的 Model.useModel 的 api 来支持这一功能,预计在接下来的几个版本中支持
Component
Dialog
Reproduction link
https://riddle.alibaba-inc.com/riddles/4683412b
Steps to reproduce
点击show按钮,dialog无法弹出,控制台有报错