slmgc / react-hint

Tooltip component for React, Preact, Inferno
https://react-hint.js.org/
MIT License
335 stars 28 forks source link

does this have typescript definitions? #33

Closed paigeflourin closed 5 years ago

paigeflourin commented 5 years ago

i'd like to use it for my project but my project uses typescript. can it work in typescript?

slmgc commented 5 years ago

It doesn't have typescript definitions, but I believe it should be pretty easy to use with typescript without definitions or create ones from scratch. You are welcome to contribute :3

paigeflourin commented 5 years ago

How do I make a component as the content? sorry i am quite confused with the docs

slmgc commented 5 years ago

Hi, you can use onRenderContent property to render any component as a tooltip's content:

<ReactHint events onRenderContent={(target, content) =>
    <SomeCustomComponent content={content} />
} />

Feel free to ping me if this doesn't answer your question.

whitepotato commented 5 years ago

Could not find a declaration file for module 'react-hint'. Try npm install @types/react-hint if it exists or add a new declaration (.d.ts) file containing declare module 'react-hint'; TS7016

slmgc commented 5 years ago

@whitepotato that's because no one contributed type definitions, but you a welcome to do it