masroorejaz / react-simple-captcha

A very simple and powerful captcha for ReactJS
40 stars 19 forks source link

Can't be used with TypeScript #33

Closed jacksrm closed 11 months ago

jacksrm commented 11 months ago

Until now I can't find a good way to use it with typescript cause there's no type exported in the lib.

masroorejaz commented 11 months ago

Currently it's not compatible with typescript.

Thank you.

Stuart88 commented 9 months ago

In your project source directory create a types folder and make a types file so typescript will not hit an error.

/// \src
/// ..\types
/// ..\..\react-simple-captcha.d.ts

declare module 'react-simple-captcha';

Now typescript lets you use it without types.

masroorejaz commented 9 months ago

@Stuart88 Thank you for providing the solution

I am pinning down your solution link to the main page of NPM.

Again thank you so much.