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

Function useHideMobileSidebar

packages/shared/src/hooks/useHideMobileSidebar.ts:8–26  ·  view source on GitHub ↗
({
  state,
  action,
}: UseHideMobileSidebarProps)

Source from the content-addressed store, hash-verified

6 action: () => unknown;
7}
8export default function useHideMobileSidebar({
9 state,
10 action,
11}: UseHideMobileSidebarProps): void {
12 const router = useRouter();
13
14 // eslint-disable-next-line eslint-compat/consistent-return
15 useEffect(() => {
16 if (state) {
17 router?.events?.on('routeChangeStart', action);
18
19 return () => {
20 router?.events?.off('routeChangeStart', action);
21 };
22 }
23 // @NOTE see https://dailydotdev.atlassian.net/l/cp/dK9h1zoM
24 // eslint-disable-next-line react-hooks/exhaustive-deps
25 }, [state]);
26}

Callers

nothing calls this directly

Calls 1

useRouterFunction · 0.50

Tested by

no test coverage detected