react-anchor-link-smooth-scroll icon indicating copy to clipboard operation
react-anchor-link-smooth-scroll copied to clipboard

Typescript support?

Open kennycason opened this issue 4 years ago • 3 comments

Hi, I like the library however am unable to use it in my Typescript project. Any plan on adding the type files? Thanks!

kennycason avatar Mar 23 '20 19:03 kennycason

I don't know if this is totally right, but it may help you. Add it to your types folder.

declare module 'react-anchor-link-smooth-scroll' {
  interface Props {
    href: string;
    offset?: function | number;
    onClick?: (e: Event) => void;
    [key: string]: any;
  }

  export default class AnchorLink extends React.Component<Props> {}
}

luismramirezr avatar Mar 29 '20 04:03 luismramirezr

@luismramirezr Thanks, I'll give it a spin.

kennycason avatar Mar 31 '20 02:03 kennycason

@luismramirezr You should open a PR or submit your code to https://github.com/DefinitelyTyped/DefinitelyTyped!

rramphal avatar Nov 11 '20 19:11 rramphal