You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.1 KiB
27 lines
1.1 KiB
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.getShadowNodeFromRef = getShadowNodeFromRef;
|
|
// Used by GestureDetector (unsupported on web at the moment) to check whether the
|
|
// attached view may get flattened on Fabric. This implementation causes errors
|
|
// on web due to the static resolution of `require` statements by webpack breaking
|
|
// the conditional importing. Solved by making .web file.
|
|
let findHostInstance_DEPRECATED;
|
|
|
|
function getShadowNodeFromRef(ref) {
|
|
// load findHostInstance_DEPRECATED lazily because it may not be available before render
|
|
if (findHostInstance_DEPRECATED === undefined) {
|
|
try {
|
|
findHostInstance_DEPRECATED = // eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;
|
|
} catch (e) {
|
|
findHostInstance_DEPRECATED = _ref => null;
|
|
}
|
|
} // @ts-ignore Fabric
|
|
|
|
|
|
return findHostInstance_DEPRECATED(ref)._internalInstanceHandle.stateNode.node;
|
|
}
|
|
//# sourceMappingURL=getShadowNodeFromRef.js.map
|