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

feat: add _internalComponents for antd to fix findDOMNode warning #715

Merged
merged 2 commits into from
May 17, 2024

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented May 17, 2024

在 antd 中,对于 MenuItem 会添加一个 Tooltip 用于收缩时展示气泡提示。但是在 rc-menu 中,有一个看不见的节点会对完整的 KV 路径进行收集。而看不见的节点会被 fallback 到 findDOMNode 提示 warning 信息。

这个 fix 通过提供一个 _internalComponents 用于定制组件,暂时不进行大的重构。让 antd 在渲染测使用自己的组件,而收集测使用原生组件。因此会对 items 执行两次结构生成。

注意:该更新会降低 headless 下使用 rc-menu 的性能。

@zombieJ zombieJ merged commit efba6a5 into master May 17, 2024
7 checks passed
@zombieJ zombieJ deleted the hack branch May 17, 2024 07:24
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

Successfully merging this pull request may close these issues.

1 participant