mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-16 20:24:01 +02:00
Change how Slate context updates and introduce useSlateSelection
hook (#5041)
* Fix DOM selection sync when there are unexpected rerenders * Create a useSlateSelection hook and expose it * update docs * add changeset * Undo the useEffect change and add a useSlateValue method * Use a version counter instead for SlateContext * comment out layout effect prevention for now * Undo useV comparison for now * Change the changeset * Fix lint * Remove the useSlateValue hook * remove some unused imports * Add useSlateWithV to the docs * fix changeset lint * Change changeset to minor instead
This commit is contained in:
7
.changeset/angry-files-kick.md
Normal file
7
.changeset/angry-files-kick.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'slate-react': minor
|
||||
---
|
||||
|
||||
- Introduces a `useSlateSelection` hook that triggers whenever the selection changes.
|
||||
- This also changes the implementation of SlateContext to use an incrementing value instead of an array replace to trigger updates
|
||||
- Introduces a `useSlateWithV` hook that includes the version counter which can be used to prevent re-renders
|
Reference in New Issue
Block a user