Skip to content

Instantly share code, notes, and snippets.

View thefat32's full-sized avatar

Lucas Picchi thefat32

  • Mar del Plata, Argentina
View GitHub Profile
@thefat32
thefat32 / ReactTextFit.tsx
Last active July 4, 2023 19:44
React fit text component using measureText(), binary searchand ResizeObservable
import React, { useLayoutEffect, useState } from 'react';
import useResizeObserver from '../../hooks/useResizeObserver';
class NotSupportedError extends Error {
constructor(message: string) {
super(message);
this.name = 'NotSupportedError';
}
}