react-countup
react-countup copied to clipboard
Property 'duration' does not exist on type 'IntrinsicAttributes & CountUpProps'
Typescript raises TS(2322) error for the following code <CountUp end={item.value} duration={1.2} />
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;
}
}