feat(joint-react): add new set hooks and better ts support #2947
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
https://github.com/orgs/clientIO/projects/6/views/13?pane=issue&itemId=107895468
This PR addresses several improvements and fixes related to TypeScript support in
@joint/react
, particularly focusing on method visibility and the addition of new functions. Below are the key changes introduced:@joint/react
Changes:New set hooks:
useAddLink
anduseAddElement
hooks for adding (pushing) new data to the stateuseRemoveCell
hook, for remove cell or link based ondia.cell.id
Minor Adjustments in React Components:
Motivation and Context
The main motivation for this update is to improve the accessibility and flexibility of the cache-clearing functionality by making the
clearNodeCache
andclearNodesCache
methods publicly available. The new set methods for@joint/react
- we had been missing adding and removing elements.Plus generate new autogerated docs.
These changes ensure better performance and usability for users who interact with the JointJS API, making it easier to manage elements and their cached states within a graph.