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

18 lines
513 B
JavaScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = safeFindDOMNode;
var _reactDom = _interopRequireDefault(require("react-dom"));
function safeFindDOMNode(componentOrElement) {
if (componentOrElement && 'setState' in componentOrElement) {
return _reactDom["default"].findDOMNode(componentOrElement);
}
return componentOrElement != null ? componentOrElement : null;
}
module.exports = exports.default;