切换组件时重置检查面板展开状态
按组件身份变化同步展开状态,避免沿用上一个节点的折叠状态
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ export function ComponentPanel(props: ComponentPanelProps) {
|
||||
useEffect(() => {
|
||||
const previous = previousComponentRef.current;
|
||||
previousComponentRef.current = component;
|
||||
if (Boolean(component) !== Boolean(previous)) {
|
||||
if (component !== previous) {
|
||||
setExpanded(Boolean(component));
|
||||
}
|
||||
}, [component]);
|
||||
|
||||
Reference in New Issue
Block a user