MCPcopy Create free account
hub / github.com/atomicdata-dev/atomic-data-browser / useFocus

Function useFocus

data-browser/src/helpers/useFocus.tsx:4–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3/** Hook for programmaticall setting focus */
4export const useFocus = (): [React.RefObject<unknown>, () => void] => {
5 const htmlElRef = useRef(null);
6 const setFocus = () => {
7 htmlElRef.current && htmlElRef.current.focus();
8 };
9
10 return [htmlElRef, setFocus];
11};

Callers 1

NavBarFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected