Skip to content
New issue

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

children type NodeComponentType not exposed for consumption #81

Open
jdmg94 opened this issue Oct 8, 2021 · 1 comment
Open

children type NodeComponentType not exposed for consumption #81

jdmg94 opened this issue Oct 8, 2021 · 1 comment

Comments

@jdmg94
Copy link

jdmg94 commented Oct 8, 2021

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

@gregjoeval
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants