UNPKG

use-truncate-from-middle

Version:

React hook which dynamically calculates the maximum number of characters that fit into an HTML element and truncates the text from middle with given middle chars.

8 lines (7 loc) 211 B
import { Target } from '../../utils/getTargetElement'; /** * Returns current width of specified element. * */ declare const useElementWidth: (target: Target) => number; export default useElementWidth;