Skip to content
New issue

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

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

Already on GitHub? # to your account

React 19 drops support for findDOMNode #150

Open
smoores-dev opened this issue Dec 18, 2024 · 1 comment
Open

React 19 drops support for findDOMNode #150

smoores-dev opened this issue Dec 18, 2024 · 1 comment

Comments

@smoores-dev
Copy link
Collaborator

See also the issue on the React repo: facebook/react#31836

findDOMNode has been deprecated for several major versions (since 16, I think?). The docs have always said:

There is currently no direct equivalent for this use case, which is why findDOMNode is deprecated but is not yet removed completely from React

Leading me to believe that there would be an alternative mechanism for ref-ing a text node before this was removed. Unfortunately, this doesn't seem to be the case. I've opened an issue with the React folks, and we'll see if that goes anywhere. In the meantime, it's impossible to use React ProseMirror with React 19.

If React doesn't end up addressing this, then we are going to have to find an alternative approach to ref-ing our text nodes. I think we may be able to extend the code that we use to resolve text nodes in CompositionViewDescs to search for text nodes generally, but I'm worried about have to rely on assumptions about child nodes that might not be sufficiently robust.

@smoores-dev
Copy link
Collaborator Author

Most likely a bad idea, but there is this: https://www.npmjs.com/package/find-dom-node-polyfill

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

No branches or pull requests

1 participant