[React 19] findDOMNode
is removed, with no suitable replacement for text nodes
#31836
Labels
findDOMNode
is removed, with no suitable replacement for text nodes
#31836
Summary
In React 18 and below, the only way to obtain a reference to a text node rendered by a React component is with
findDOMNode
. The docs indicated that the reasonfindDOMNode
hadn't been removed was because there were no alternatives to use cases like this.This seems like an extremely narrow edge case (why would you need a ref to a text node, right?), but @nytimes/react-prosemirror is heavily reliant on this API. Because this is a rich text editing library, we can't wrap text nodes with ref-able elements without introducing complexity/edge cases.
What should we do here? I understand the desire to remove a long-deprecated API, but React ProseMirror is now somewhat in a lurch.
A simplified version of how React ProseMirror uses
findDOMNode
:The text was updated successfully, but these errors were encountered: