I am trying to use https://github.com/arnaudbenard/redux-mock-store with TypeScript. I have also installed @types/redux-mock-store
which has export default createStore
.
I have tried importing using:
import createStore from 'redux-mock-store';
import * as createStore from 'redux-mock-store';
TypeScript does not show any errors for the first import, but when I actually run the code it doesn't work since I get redux_mock_store1.default
is not a function.
The second attempt works properly when I actually run my tests, but TypeScript complains "Cannot invoke an expression whose type lacks a call signature" saying that the default export of @types/redux-mock-store
has no compatible index signatures.
How can I properly import or use module so that TypeScript doesn't report any errors?