react-virtualized-tree
react-virtualized-tree copied to clipboard
Example of how to use indexSearch?
indexSearch: (searchTerm: string, nodes: FlattenedNode[]) => (node: FlattenedNode) => boolean;
I see the structure, but I'm wondering if someone could provide an example of a baseline version of a custom function for this prop. There's no documentation around how to use this I see the final result from this function is a boolean, but an example would clarify this better for me.
Thanks in advanced.
I'm also a bit confused on this. I saw it was marked as required, but I have no idea what it wants for an implementation. Any guidance here?
const indexByName = searchTerm => ({name}) => {
const upperCaseName = name.toUpperCase();
const upperCaseSearchTerm = searchTerm.toUpperCase();
return upperCaseName.indexOf(upperCaseSearchTerm.trim()) > -1;
};