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

Use library in React TSX #48

Open
ghost opened this issue Aug 15, 2018 · 1 comment
Open

Use library in React TSX #48

ghost opened this issue Aug 15, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 15, 2018

When try to use the TSX file as import ReactSummernote from 'react-summernote';

How can i create definition file for Summernote.jsx so that i dont get react-summernote module not found.

and where i need to place that file and code snippet for the d.ts file.

Thanks,

@mcfa77y
Copy link

mcfa77y commented Sep 9, 2020

I followed these instructions
https://www.detroitlabs.com/blog/2018/02/28/adding-custom-type-definitions-to-a-third-party-library/
I didn't type anything just created a bare bones *.d.ts file

create directory typings_custom at project root

mkdir typings_custom

create type file

touch typings_custom/react-summernote.d.ts

add line to react-summernote.d.ts
declare module 'react-summernote'

update tscongif.js to use new custom typing directory

"include": [
"./typings_custom/**/*.ts"
],

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

1 participant