itpresidents / thesis-archive-2020

11 stars 1 forks source link

add useFirstClick #45

Closed EonYang closed 4 years ago

EonYang commented 4 years ago

The design requires lots of onUserFirstInteract, so I created this component to listen to first click, scroll or touchmove.

import { useFirstClick } from "../util/useFirstClick";
  const didFirstClick = useFirstClick();
  useEffect(collapseHeaderAndShowMessage, [didFirstClick]);

I hope this gets merged then we can start using it.