-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
[FEAT-REQ] Custom ID type for TreeNode #42
Comments
@GamerGirlandCo Hey there! 👋 Thanks for your feature request and your interest in contributing to the project! For IDs, I'd suggest using So, the TreeNode would look like this: export interface TreeNode<T extends (string| number)> {
id: T;
name: string;
children?: TreeNode<T>[];
[key: string]: any;
} If you'd like to work on this feature and make a PR for it, please ensure all test cases pass and that necessary refactorizations are in place. Feel free to reach out if you have any questions. Your contribution is much appreciated! |
Is your feature request related to a problem? Please describe.
I tried changing an existing data type in my project to extend
TreeNode
. However, since the ID is assumed to be a string, typescript complains.Describe the solution you'd like
Change the TreeNode interface to be generic
Describe alternatives you've considered
N/A
Screenshots or screen records
N/A
Additional context
N/A
Would you like to work on this feature?
Absolutely!
The text was updated successfully, but these errors were encountered: