MCPcopy Create free account
hub / github.com/adobe/react-spectrum / isShadowRoot

Function isShadowRoot

packages/react-aria/src/utils/domHelpers.ts:64–67  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

62 * distinguish ShadowRoot from other values.
63 */
64export function isShadowRoot(value: unknown): value is ShadowRoot {
65 // 11 = DOCUMENT_FRAGMENT_NODE
66 return isNode(value) && value.nodeType === 11 && 'host' in value;
67}
68
69/**
70 * Attaches an event listener on target(s) and returns a cleanup function.

Callers 3

nodeContainsFunction · 0.90
getPropagationTargetsFunction · 0.90
ariaHideOutsideFunction · 0.90

Calls 1

isNodeFunction · 0.85

Tested by

no test coverage detected