We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
how to close all nodes?
The text was updated successfully, but these errors were encountered:
isOpenByDefault: false
Sorry, something went wrong.
this is what I've done, hope this helps
const ref = useRef<FixedSizeTree<ITreeWalkerData>>(null); const collapseAllNodes = useCallback(async () => { await ref.current?.recomputeTree( Object.fromEntries( // Note: This is for a tree with multiple root nodes rootNodes.map( (m): RecomputeTreeKeyValuePair => [ createNodeId(m.key), { open: false, subtreeCallback: (node) => { // NOTE: this is permitted by the library and is faster than using setOpen node.isOpen = false; }, }, ] ) ) ); }, [rootNodes]); return ( <div> <button onClick={collapseAllNodes}>Collapse All</button> <FixedSizeTree ... ref={ref} > ... </FixedSizeTree> </div> )
No branches or pull requests
how to close all nodes?
The text was updated successfully, but these errors were encountered: