You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a lot of changes regarding types for nodes and edges in React Flow 12. We have a new guide that explains everything but we should double check if it's correct and if it all works. It would be nice if we could add a section about how to type useStore correctly on user side.
The text was updated successfully, but these errors were encountered:
Which gave me correct typing of the data prop when I then wrapped this component in a more specific use case. However, this did not translate at all to v12.
v12
The path of least refactoring ended up being this:
Where I had to cut&paste the source code for NodeBase from the xyflow github, and add it to my own codebase. Fortunately, Typescript falls back to duck typing, and this is a working solution that compiler/linter are happy with. However, I would naturally prefer not to have to expose aspects of a libraries internals that aren't intentionally part of its API.
Is there a simpler solution I could have applied?
If not, could the NodeBase be added to the exposed API?
Or if not, could the Type definitions be revised to better infer generic data types?
There are a lot of changes regarding types for nodes and edges in React Flow 12. We have a new guide that explains everything but we should double check if it's correct and if it all works. It would be nice if we could add a section about how to type
useStore
correctly on user side.The text was updated successfully, but these errors were encountered: