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

typings for react-linkify #53

Open
droegier opened this issue Nov 27, 2017 · 2 comments
Open

typings for react-linkify #53

droegier opened this issue Nov 27, 2017 · 2 comments

Comments

@droegier
Copy link

I needed typings to use this library in my React app using Typescript, but couldn't find any. I didn't want to create a perfect file, but just needed something that works. This "index.d.ts" did it for me. In case anyone wants to re-use this or improve it, so it may be included as part of this library : feel free.

declare module 'react-linkify' {
    export default class Linkify extends React.Component<any, any> {
    }
}
@iimos
Copy link

iimos commented Jul 11, 2019

type Props = {
  children: React.ReactNode,
  componentDecorator?: (decoratedHref: string, decoratedText: string, key: number) => React.ReactNode,
  hrefDecorator?: (href: string) => string,
  matchDecorator?: (text: string) => Array<Object>,
  textDecorator?: (text: string) => string,
};

declare module 'react-linkify' {
  export default class Linkify extends React.Component<Props> {}
}

@zaunerc
Copy link
Contributor

zaunerc commented Sep 2, 2019

Also see #62 and #83 for relevant pull requests.

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