mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-26 10:25:14 +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;
|
||
|
}
|