I'm trying to add redux-persist to my React project (using typescript). But I have some trouble. Compiling falls with following error:
Could not find a declaration file for module 'redux-persist/lib/storage'. '.../WebstormProjects/catalog/node_modules/redux-persist/lib/storage/index.js' implicitly has an 'any' type.
Try `npm install @types/redux-persist` if it exists or add a new declaration (.d.ts) file containing `declare module 'redux-persist/lib/storage'
I installed the following packages: "@types/redux-persist": "^4.3.1" and "redux-persist": "^6.0.0".
Content of redux-persist/lib/storage:
declare module "redux-persist/es/storage" {
import { WebStorage } from "redux-persist/es/types";
const localStorage: WebStorage;
export default localStorage;
}
declare module "redux-persist/lib/storage" {
export * from "redux-persist/es/storage";
export { default } from "redux-persist/es/storage";
}
What to do to solve this problem?