我有导入debounce
库合适到react + typescript
项目的问题。reactJs + typescript + debounce - 无法正常导入debounce
我做:
npm install debounce --save
typings install dt~debounce --save --global
- 在我的文件,导入防抖动为:
import debounce from 'debounce';
- 使用反跳这样的:
debounce(function(){ console.log('testtt'); })();
有了这些代码我的代码compllation传递,但当我试图运行我们bside我得到错误:
Uncaught TypeError: debounce_1.default is not a function
我到底做错了什么?
感谢