-
Notifications
You must be signed in to change notification settings - Fork 268
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
fix: Add TypeScript definitions #223
Conversation
@ellinge This is really great! |
Are you done with this? It seems like we can merge this and get a release out (will get radio once #217 gets merged). Also, I think we should separate out action related changes (see my comments regarding them) so that we can get the typings out. |
I want to be sure with the typings for onAction first. I think we need to split TreeNode (props and return) as well since the return-object does not include children anymore (it's set to undefined). Should we expose the _id/id props as well? Do you think we should expose any "internal" props and methods as well. Such as node and searchInput. We actually use them to set the width of the dropdown to the div-node and handling tabbing in and out of the dropdown. I guess others are interested in their expose as well without casting the whole ref to any instead.
|
No, since they are internal to the component. If anyone needs
Let me think about this and I'll get back to you. |
Code Climate has analyzed commit 3cad026 and detected 0 issues on this pull request. View more on Code Climate. |
Many thanks for adding this! |
## What does it do? An issue in #223 for children. An array of Node[] instead of TreeNode[] was specified. ## Type of change - [x] Bug fix
Adds TypeScript-definitions I also noticed that onAction is not correctly implemented. Currently sends a { action: string, id: string }. There is code in index.js which tries to fetch the node. But it does not seem be working. It expects two parameters but receives the object described above in the first parameter. ![bild](https://user-images.githubusercontent.com/17863113/54728331-8d972980-4b7d-11e9-9490-a3bd6b08481f.png) Changed the examples/stories to get the node id at least. Also changed in readme where onAction should be applied. Fixes #209 - [X] New feature
## What does it do? An issue in #223 for children. An array of Node[] instead of TreeNode[] was specified. ## Type of change - [x] Bug fix
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds TypeScript-definitions
I also noticed that onAction is not correctly implemented. Currently sends a { action: string, id: string }.
There is code in index.js which tries to fetch the node. But it does not seem be working. It expects two parameters but receives the object described above in the first parameter.
Changed the examples/stories to get the node id at least.
Also changed in readme where onAction should be applied.
Fixes #209