Skip to content

[react-native] Support for react-dom@19 #4108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kerwanp
Copy link
Contributor

@kerwanp kerwanp commented Jun 30, 2025

Description

In react-dom@19 the function findDOMNode has been removed. Instead the ref actually contains the Element.
To support both 18 and 19 version we check wether findDOMNode is defined.

image

Copy link

changeset-bot bot commented Jun 30, 2025

🦋 Changeset detected

Latest commit: af4e2a7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@builder.io/sdk-react-native Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kerwanp kerwanp changed the title feat(react-native): access DOMNode directly from ref in React 19 [react-native] Support for react-dom@19 Jun 30, 2025
Copy link

nx-cloud bot commented Jun 30, 2025

View your CI Pipeline Execution ↗ for commit af4e2a7.

Command Status Duration Result
nx test @snippet/react-sdk-next-14-app ✅ Succeeded 1m 15s View ↗
nx test @snippet/angular-17 ✅ Succeeded 2m 50s View ↗
nx test @e2e/gen1-next15-app ✅ Succeeded 6m 5s View ↗
nx test @e2e/gen1-react ✅ Succeeded 5m 26s View ↗
nx test @e2e/gen1-remix ✅ Succeeded 5m 19s View ↗
nx test @snippet/angular-17-ssr ✅ Succeeded 1m 26s View ↗
nx test @snippet/hydrogen ✅ Succeeded 1m 7s View ↗
nx test @snippet/react-sdk-next-pages ✅ Succeeded 2m 32s View ↗
Additional runs (18) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-06-30 11:01:46 UTC

@kerwanp
Copy link
Contributor Author

kerwanp commented Jun 30, 2025

On as side note, I gave react-compiler a try on our Expo app and it failed. It seems related to Builder as the type prop of the JSX element provided for components with children become undefined with react-compiler.

In the following example children[0].type is a JSX.Element with $$typeof: Symbol(react.memo). With react-compiler it becomes undefined.

{
    name: "MyComponent",
    component: ({ children }) => {
       console.log(children[0].type)
       return children
    },
    canHaveChildren: true,
}

I will find some time for testing and maybe opening an other PR for react-compiler support

Copy link
Contributor

@sidmohanty11 sidmohanty11 left a comment

Choose a reason for hiding this comment

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

thanks for the fix @kerwanp !! LGTM.

"@builder.io/sdk-react-native": patch
---

Add support for React 19
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Add support for React 19
Fix: Add support for React 19 by handling `findDOMNode` deprecation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants