react-summernote icon indicating copy to clipboard operation
react-summernote copied to clipboard

Use library in React TSX

Open ghost opened this issue 7 years ago • 1 comments

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,

ghost avatar Aug 15 '18 23:08 ghost

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" ],

mcfa77y avatar Sep 09 '20 23:09 mcfa77y