Note: Currently points to #3 to make the diff easier to read. Will update when that's merged.
Notable changes:
-
Updates state management that deals with Yjs to use
useSyncExternalStore(), which greatly simplifies and reduces the amount of code needed to get state based on Yjs by making Yjs the one source of truth for state based on it (no more state syncing withuseState() + useEffect()) -
Removes unnecessary usages of
useState()to derive state that can be directly calculated
_Note: Currently points to #3 to make the diff easier to read. Will update when that's merged._
Notable changes:
- Updates state management that deals with Yjs to use [`useSyncExternalStore()`](https://react.dev/learn/you-might-not-need-an-effect#subscribing-to-an-external-store), which greatly simplifies and reduces the amount of code needed to get state based on Yjs by making Yjs the one source of truth for state based on it (no more state syncing with `useState() + useEffect()`)
- Removes unnecessary usages of `useState()` to derive state that can be [directly calculated](https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state)