redux-persist on typescript
See original GitHub issueAnyone here can give me a simple implementations of a redux-persist on typescript? I always got error like this when i try to create persistor
Argument of type 'Store<{ readonly [$CombinedState]?: undefined; } & { todo: TodoState; } & PersistPartial, TodoActionTypes>' is not assignable to parameter of type 'Store<any, AnyAction>'. Types of property 'dispatch' are incompatible. Type 'Dispatch<TodoActionTypes>' is not assignable to type 'Dispatch<AnyAction>'. Type 'AnyAction' is not assignable to type 'TodoActionTypes'. Type 'AnyAction' is not assignable to type 'DeleteTodoAction'.
This my code
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:27
- Comments:20
Top Results From Across the Web
Persisting your React application state with Redux and ...
How to manage and save your application state to any kind of storage using redux-persist. If you've ever developed a React application and ......
Read more >How to add redux-persist to typescript project? - Stack Overflow
I'm trying to add redux-persist to my React project (using typescript). But I have some trouble. Compiling falls with following error:
Read more >How To Clear a Redux Toolkit State That's Using redux-persist ...
Using redux-persist to persist and rehydrate state if the user closes, or refreshes / uses the navigation buttons on their browser. Generating a...
Read more >redux-persist migrations in TypeScript with a little help from ...
redux -persist migrations in TypeScript with a little help from patch-package - persistMigration.ts. ... import { createMigrate } from 'redux-persist';.
Read more >redux-persist persistReducer TypeScript Examples
redux -persist#persistReducer TypeScript Examples ... The following examples show how to use redux-persist.persistReducer. You can vote up the ones you like or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My fix may not be so relevant, but this question at least led me to a solution so I’ll post it in the off chance someone with the same problem as I comes across this.
I just had to type persistReducer. For example:
if you are using redux/toolkit and are getting this error or losing typing on your selectors then use the following configuration:
store.ts