Skip to content

fix: remove the use of findDOMNode#471

Open
onurio wants to merge 4 commits intokrakenjs:mainfrom
onurio:fix/react-finddomnode
Open

fix: remove the use of findDOMNode#471
onurio wants to merge 4 commits intokrakenjs:mainfrom
onurio:fix/react-finddomnode

Conversation

@onurio
Copy link
Copy Markdown

@onurio onurio commented May 7, 2025

This PR aims to remove the use of findDOMNode and by this allowing zoid to be used with React 19 (fixed #396)

React minimum version is now 16.3

https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-reactdom-finddomnode

@onurio onurio requested a review from a team as a code owner May 7, 2025 20:48
- Replace ReactDOM.findDOMNode with React.createRef() for React 16.3+ compatibility
- Add fallback to callback refs for older React versions
- Make implementation backward compatible to support all React versions
- Update flow types to fix typechecking errors
- Keep minimal findDOMNode fallback only for test environment
@onurio onurio changed the title fix: remove deprecated use of findDOMNode fix: backwards compatible deprecation of findDOMNode May 7, 2025
@onurio onurio changed the title fix: backwards compatible deprecation of findDOMNode fix: remove the use of findDOMNode May 7, 2025
@sebsobseb
Copy link
Copy Markdown

sebsobseb commented Sep 4, 2025

@ravishekhar is there any chance of getting this merged / released any time soon so that zoid is compatible with React 19? Thanks.

@joegirgis
Copy link
Copy Markdown

Can we get this merged to support React 19 please? we are still using Zoid and had to revert the React update because it's not working with React 19

@joegirgis
Copy link
Copy Markdown

For anyone still suffering from this error I solved it by using this pollyfill
https://www.npmjs.com/package/find-dom-node-polyfill

Then I patch REACTDOM

import { findDOMNode } from 'find-dom-node-polyfill';
(ReactDOM as any).findDOMNode = findDOMNode;

Then I pass the patched REACTDOM to Zoid
const iFrameInstance = zoid.create({ //options passed here })
const iFrame = iFrameInstance.driver('react', { React, ReactDOM, });

jimmyn added a commit to MONEI/zoid that referenced this pull request Mar 24, 2026
Replace ReactDOM.findDOMNode with React.createRef in the React driver.
findDOMNode was removed in React 19, blocking upgrade.

Based on krakenjs#471 by @onurio.

BREAKING: React driver no longer requires ReactDOM parameter.
Minimum React version: 16.3
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.

findDOMNode is deprecated in StrictMode

3 participants