'use strict'; import type { ComponentRef } from 'react'; import type { View } from 'react-native'; /* eslint-disable */ type LocalGlobal = typeof global & Record; export function isFabric() { return !!(global as LocalGlobal).RN$Bridgeless; } export type HostInstance = { __internalInstanceHandle: Record; __nativeTag: number; _viewConfig: Record; }; export function getShadowNodeWrapperAndTagFromRef( ref: ComponentRef | null, ): { shadowNodeWrapper: any; tag: number; } { if (!ref) { return { shadowNodeWrapper: null, tag: -1, }; } const internalRef = ref as unknown as HostInstance; return { shadowNodeWrapper: internalRef.__internalInstanceHandle.stateNode.node, tag: internalRef.__nativeTag, }; }