GoScrobble/web/node_modules/react-overlays/esm/safeFindDOMNode.js

8 lines
284 B
JavaScript

import ReactDOM from 'react-dom';
export default function safeFindDOMNode(componentOrElement) {
if (componentOrElement && 'setState' in componentOrElement) {
return ReactDOM.findDOMNode(componentOrElement);
}
return componentOrElement != null ? componentOrElement : null;
}