MCPcopy Index your code
hub / github.com/react/react / getActiveElement

Function getActiveElement

packages/react-dom-bindings/src/client/getActiveElement.js:10–20  ·  view source on GitHub ↗
(doc: ?Document)

Source from the content-addressed store, hash-verified

8 */
9
10export default function getActiveElement(doc: ?Document): ?Element {
11 doc = doc || (typeof document !== 'undefined' ? document : undefined);
12 if (typeof doc === 'undefined') {
13 return null;
14 }
15 try {
16 return doc.activeElement || doc.body;
17 } catch (e) {
18 return doc.body;
19 }
20}

Callers 3

getActiveElementDeepFunction · 0.85
setDefaultValueFunction · 0.85
constructSelectEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected