Skip to content

Conversation

@onurio
Copy link

@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

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

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

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, });

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