Skip to content

Commit

Permalink
Merge pull request #13 from birdwingo/fix/remeasure-when-font-changed
Browse files Browse the repository at this point in the history
fix: remeasure when font changed
  • Loading branch information
LukasFridmansky authored Aug 1, 2024
2 parents 3627fa6 + a61c5b8 commit 02511fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/SpinningNumbers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ const SpinningNumbers: FC<SpinningNumbersProps> = ( {

}, deps );

useEffect( () => {

measured.current = false;

}, [ fontSize, fontFamily, fontWeight ] );

const measurementsToRender: ReactNode[] = [];

if ( ( animation.animable || autoMeasure ) && !measured.current ) {
Expand Down

0 comments on commit 02511fd

Please sign in to comment.