A collection of React Hooks in Typescript
// Example of usage
const [containerRef, scrollY] = useMouseScroll<HTMLDivElement>();
...
<div ref={containerRef}>content</div>
// Example of usage
const [buttonRef, buttonHovered] = useMouseHover<HTMLButtonElement>();
const color = buttonHovered ? 'red' : 'blue';
return (
<button
ref={buttonRef}
style={{ color }}
>
click me
</button>
);
// Example of usage
const [width, height] = useWindowResize();
// Example of usage
// const [waitingPerm, grantedPerm] = useAndroidPermissions();
// const printMessage = () => console.log('back button pressed');
// useAndroidBackNavigationEffect(printMessage);