react-countup icon indicating copy to clipboard operation
react-countup copied to clipboard

Property 'duration' does not exist on type 'IntrinsicAttributes & CountUpProps'

Open solarleb opened this issue 9 months ago • 1 comments

Typescript raises TS(2322) error for the following code <CountUp end={item.value} duration={1.2} />

solarleb avatar Apr 26 '25 15:04 solarleb

Adding this file resolved the issue for me.

// types/react-countup.d.ts


import 'react-countup';
import { CountUpProps as OriginalCountUpProps } from 'react-countup';

declare module 'react-countup' {
  export interface CountUpProps extends OriginalCountUpProps {
    duration?: number;
    enableScrollSpy?: boolean;
    scrollSpyOnce?: boolean;
  }
}

afrojuju1 avatar Apr 29 '25 15:04 afrojuju1