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

TypeScript support #395

Open
nosferatu500 opened this issue Nov 12, 2021 · 1 comment
Open

TypeScript support #395

nosferatu500 opened this issue Nov 12, 2021 · 1 comment
Labels
triage-needed Await triage for this

Comments

@nosferatu500
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

https://github.com/nosferatu500/react-sortable-tree/releases/tag/v4.0.0

@nosferatu500 nosferatu500 added the triage-needed Await triage for this label Nov 12, 2021
@mgunnerud
Copy link
Contributor

@nosferatu500 thanks for the new version heads-up! We use typescript, so I upgraded to v4.0.0. However, it seems that the path types (path, nextPath, prevPath, ...) are set to number[] in the typings, while the documentation states that these can be number[] or string[]:

Generate an object with additional props to be passed to the node renderer. Use this for adding buttons via the buttons key, or additional style / className settings.
({ node: object, path: number[] or string[], treeIndex: number, lowerSiblingCounts: number[], isSearchMatch: bool, isSearchFocus: bool }): object

type GenerateNodePropsParams = {
  node: any
  path: number[]
  treeIndex: number
  lowerSiblingCounts: number[]
  isSearchMatch: boolean
  isSearchFocus: boolean
}

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

No branches or pull requests

2 participants