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

fix(dashboard): avoid render PanelVizAddons in ClientPanelRender #1616

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

ZeekoZhu
Copy link
Contributor

开发者在使用 PanelAddon 时,可能会用 ClientPanelRender 在 Panel 的逻辑树内部渲染当前 Panel,这就有可能造成递归的渲染。之前采取了一些措施来避免这种情况:

const OptionalAddon = withAddon ? PanelAddonProvider : React.Fragment;

但是这里的处理不够彻底,因为在逻辑树上递归渲染的缘故,里层的 PanelVizAddons 组件可能会将 Addon 挂载到顶层的普通 Panel 上。

现在 PanelVizAddons 组件会检查当前的 withAddon 状态(ClientPanelRender 会将其设置为 false),从而避免递归渲染 Addon。

@GerilLeto GerilLeto force-pushed the fix-bug-in-nested-panel-addon branch from 2cb3da9 to 4f25f59 Compare February 17, 2025 10:11
@GerilLeto GerilLeto merged commit fdd8eec into main Feb 17, 2025
1 check passed
@GerilLeto GerilLeto deleted the fix-bug-in-nested-panel-addon branch February 17, 2025 10:11
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.

2 participants