A React component that detects when it's overflowed by its content.
Install react-overflow
using npm:
npm install --save react-overflow
import { OverflowDetector } from 'react-overflow';
function handleOverflowChange(isOverflowed) {
console.log(isOverflowed);
}
<OverflowDetector
onOverflowChange={handleOverflowChange}
style={{ width: '100px' }}
>
<div style={{ width: '200px' }}>Overflowing</div>
</OverflowDetector>