@helpscout/react-utils
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -11,2 +11,6 @@ 'use strict'; | ||
var _dashGet = require('dash-get'); | ||
var _dashGet2 = _interopRequireDefault(_dashGet); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -26,3 +30,7 @@ | ||
if (Component._reactInternalFiber) { | ||
return Component._reactInternalFiber.return && Component._reactInternalFiber.return.stateNode && Component._reactInternalFiber.return.stateNode.ownerDocument; | ||
var levelOneCheck = (0, _dashGet2.default)(Component, '_reactInternalFiber.return.stateNode.ownerDocument'); | ||
var levelTwoCheck = (0, _dashGet2.default)(Component, '_reactInternalFiber._debugOwner.return.stateNode.ownerDocument'); | ||
var levelThreeCheck = (0, _dashGet2.default)(Component, '_reactInternalFiber._debugOwner._debugOwner.return.stateNode.ownerDocument'); | ||
return levelOneCheck || levelTwoCheck || levelThreeCheck || document; | ||
} | ||
@@ -32,3 +40,3 @@ // React 15.x | ||
if (Component._reactInternalInstance) { | ||
return Component._reactInternalInstance._context && Component._reactInternalInstance._context.document; | ||
return (0, _dashGet2.default)(Component, '_reactInternalInstance._context.document', document); | ||
} | ||
@@ -38,3 +46,2 @@ /* istanbul ignore next */ | ||
} | ||
exports.default = getDocumentFromComponent; |
{ | ||
"name": "@helpscout/react-utils", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Handy utilities for React", | ||
@@ -62,4 +62,5 @@ "main": "dist/index.js", | ||
"create-react-context": "0.2.2", | ||
"dash-get": "1.0.1", | ||
"hoist-non-react-statics": "3.0.1" | ||
} | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
51483
29
924
4
1
+ Addeddash-get@1.0.1
+ Addeddash-get@1.0.1(transitive)