我有導入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
我到底做錯了什麼?
感謝