Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript support? #29

Open
kennycason opened this issue Mar 23, 2020 · 3 comments
Open

Typescript support? #29

kennycason opened this issue Mar 23, 2020 · 3 comments

Comments

@kennycason
Copy link

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

@luismramirezr
Copy link

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> {}
}

@kennycason
Copy link
Author

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

@rramphal
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants