Skip to content

Commit

Permalink
fix(Tree): 修复openKeys属性无法动态修改 #948 (#949)
Browse files Browse the repository at this point in the history
* fix: 修复table宽度

* fix(Tree): 修复openKeys属性无法动态修改
  • Loading branch information
yaob421123 authored Mar 8, 2023
1 parent b3a45f4 commit a299147
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-tree/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ export default function Tree(props: TreeProps) {
setCurSelectedKeys(props.value || props.selectedKeys || []);
}, [JSON.stringify(props.selectedKeys), JSON.stringify(props.value)]);

useEffect(() => {
setCurOpenKeys(openKeys);
}, [JSON.stringify(openKeys)]);

useEffect(() => {
let arrOpenKeys: TreeData['key'][] = [...curOpenKeys];
if (defaultExpandAll) {
Expand Down

0 comments on commit a299147

Please sign in to comment.