Closed asasvirtuais closed 2 months ago
useCallback to wrap useHash mount and unmount lifecycles
useLifecycles( useCallback( () => on(window, 'hashchange', onHashChange), []), useCallback( () => off(window, 'hashchange', onHashChange), []) );
yarn test
yarn lint
yarn lint:fix
yarn lint:types
The rabbit hole is deeper than I imagined it'd be. Seems like useEffect would be the right approach to solve this issue with Next.js, but it would completely change the way this works on React only apps.
Description
useCallback to wrap useHash mount and unmount lifecycles
Type of change
Checklist
yarn test
)yarn lint
). Fix it withyarn lint:fix
in case of failure.yarn lint:types
).