Skip to content
This repository was archived by the owner on Dec 7, 2019. It is now read-only.

Commit 77f733b

Browse files
committed
fix(react): compute filtered model on model prop change
1 parent f287b0b commit 77f733b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/react/components/TreeView.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ class TreeViewBaseClass extends React.PureComponent<TreeViewProps, TreeViewState
104104
this.defaultsMix = { ...defaults, ...nextProps }
105105
}
106106

107+
componentDidUpdate(prevProps) {
108+
if(prevProps.model !== this.props.model) {
109+
this.setState({
110+
filtered: this.rootNode.filterTree(this.state.search)
111+
})
112+
}
113+
}
114+
107115
render() {
108116
const sort = this.props.sort
109117
const props : any = this.defaultsMix || { ...defaults, ...this.props }

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy