fix: explorer update issue

This commit is contained in:
duanhongbo committed 2020-12-04 12:12:08 +08:00
1 parent 40b83c2876
commit e36b9694cb
1 file changed
+5 -2
+5 -2
View File
@@ -243,7 +243,9 @@ export default class Explorer extends Component<ExplorerProps> {
shouldComponentUpdate(nextProps: ExplorerProps) {
const shouldUpdate = this.curWorkdir != nextProps.workdir;
this.curWorkdir = nextProps.workdir;
this.updateRoot();
if(shouldUpdate){
this.updateRoot();
}
return shouldUpdate;
}
@@ -351,7 +353,8 @@ export default class Explorer extends Component<ExplorerProps> {
selectNode(id:string){
this.setState({
selectedKey:id
})
});
this.forceUpdate();
}
renderItem(node: FileDataNode) {