I am currently experimenting with using https://github.com/arnaudbenard/redux-mock-store in conjunction with TypeScript. I have gone ahead and installed @types/redux-mock-store
which includes the necessary export default createStore
statement.
In my attempts to import the module, I have tried the following:
import createStore from 'redux-mock-store';
import * as createStore from 'redux-mock-store';
The first import does not raise any TypeScript errors, however, upon running the code, I encounter an issue where I receive the message redux_mock_store1.default
is not a function.
On the other hand, the second import method works seamlessly during the test runs, but TypeScript throws an error stating "Cannot invoke an expression whose type lacks a call signature", suggesting that the default export of @types/redux-mock-store
does not have compatible index signatures.
How can I effectively import or utilize this module to prevent any TypeScript error messages?