MCPcopy Create free account
hub / github.com/dailydotdev/apps / useInert

Function useInert

packages/shared/src/features/feedWidgets/FeedWidgetFrame.tsx:15–30  ·  view source on GitHub ↗
(
  ref: RefObject<T>,
  isInert: boolean,
)

Source from the content-addressed store, hash-verified

13 * does not carry the attribute.
14 */
15export const useInert = <T extends HTMLElement>(
16 ref: RefObject<T>,
17 isInert: boolean,
18): void => {
19 useEffect(() => {
20 const node = ref.current;
21 if (!node) {
22 return undefined;
23 }
24
25 node.inert = isInert;
26 return () => {
27 node.inert = false;
28 };
29 }, [ref, isInert]);
30};
31
32export const useInertRef = <T extends HTMLElement>(
33 isInert: boolean,

Callers 1

useInertRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected