mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-28 19:35:15 +00:00
8 lines
284 B
JavaScript
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;
|
||
|
}
|