react-vtree
react-vtree copied to clipboard
children type NodeComponentType not exposed for consumption
The children prop is typed as NodeComponentProps on TreeProps, however the type is not exported. Only TreeWalker and TreeWalkerValue types get exported from ./Tree as you can see here
In order to properly type my custom tree node component this type should be exposed to the consumer of the library
for anyone wondering or in need of a work around, I believe this is the equivalent type
import { NodePublicState } from 'react-vtree/dist/es/Tree';
import { ListChildComponentProps } from 'react-window';
type ITreeWalkerData = {
// This is your data model
}
type TreeNodeComponentProps = Omit<ListChildComponentProps<ITreeWalkerData>, 'index'> & NodePublicState<ITreeWalkerData>