Skip to content

Prep for React 19 upgrade#2576

Merged
ebroder merged 1 commit intomainfrom
evan/react-prep
Dec 10, 2025
Merged

Prep for React 19 upgrade#2576
ebroder merged 1 commit intomainfrom
evan/react-prep

Conversation

@ebroder
Copy link
Member

@ebroder ebroder commented Dec 9, 2025

React 19 changed how refs behave. These changes make our code compatible with both the behavior in v18 and v19.

(I think we should theoretically be able to auto-upgrade to React 19 once this + #2575 + ianstormtaylor/slate#5986 land, although it's separately worth taking advantage of some of the new features in v19, like ref-as-prop, the new useActionState hook, and potentially the new use API for suspending while promises are resolving)

React 19 changed how refs behave. These changes make our code compatible
with both the behavior in v18 and v19.
@ebroder ebroder requested a review from zarvox December 9, 2025 21:13
Copy link
Contributor

@zarvox zarvox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like just typing changes, that allow being more precise/narrow with the actual types of the RefObjects? Sounds great.

@ebroder
Copy link
Member Author

ebroder commented Dec 10, 2025

Yeah. We'll eventually want to switch everything to MutableRefObject, since that's what all refs are in v19, but that's not backwards-compatible.

@ebroder ebroder merged commit b4de36d into main Dec 10, 2025
1 check passed
@ebroder ebroder deleted the evan/react-prep branch December 10, 2025 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants