React Hook for detecting overflow
npm install --save use-detect-overflow
// OR
yarn add use-detect-overflow
// OR
pnpm add use-detect-overflow
import * as React from 'react';
import { useDetectOverflow } from 'use-detect-overflow';
const Example = () => {
const [ref, { overflowX, overflowY }] = useDetectOverflow();
return <div ref={ref}>...</div>;
};
MIT © kaichii
This hook is created using create-react-hook.