Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

findDOMNode is different from react-dom #493

Closed
zhaopeifei opened this issue Aug 8, 2018 · 4 comments
Closed

findDOMNode is different from react-dom #493

zhaopeifei opened this issue Aug 8, 2018 · 4 comments

Comments

@zhaopeifei
Copy link

function findDOMNode() { return e && e.base || null }

but in react-dom
function findDOMNode(componentOrElement) { // ... if (componentOrElement == null) { return null; } if (componentOrElement.nodeType === 1) { return componentOrElement; } // ...

so when I use findDOMNode(element),react-dom return element,but preact return null. This cause react-slick make a mistake.

@billneff79
Copy link
Contributor

We are encountering the same issues with react-slick. I created a fix for this issue in PR #495

@rdmurphy
Copy link

Can confirm this is triggering errors in react-autocomplete too.

@dandv
Copy link

dandv commented Sep 6, 2018

@mlaursen suspects that findDOMNode may also cause the incompatibility with react-md. I've made sure preact-compat is at 3.18.4 in my reproduction repo (linked above), but I still see the issue.

@billneff79
Copy link
Contributor

I added notes to the issue in react-md: findDOMNode is not causing the issue they are seeing, but rather a lower level preact bug.

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

No branches or pull requests

4 participants