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

Function onRouteChange

packages/shared/src/components/shell/ReadingDrawer.tsx:298–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

296
297 useEffect(() => {
298 const onRouteChange = () => {
299 if (isReadingOpen()) {
300 closedBy.current = CloseReason.Leave;
301 setReadingOpen(false);
302 }
303 };
304 router.events.on('routeChangeStart', onRouteChange);
305 return () => router.events.off('routeChangeStart', onRouteChange);
306 }, [router]);

Callers 1

Calls 2

isReadingOpenFunction · 0.90
setReadingOpenFunction · 0.90

Tested by

no test coverage detected