question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript with redux-persist

See original GitHub issue

@ctrlplusb More TypeScript problems! 😅

Using the code results in this when using with TypeScript;

Argument of type '{ reducerEnhancer: (reducer: Reducer<any, any>) => Reducer<any, any>; }' is not assignable to parameter of type 'EasyPeasyConfig<any, any>'.
  Types of property 'reducerEnhancer' are incompatible.
    Type '(reducer: import("/node_modules/easy-peasy/index").Reducer<any, any>) => import("/node_modules/redux/index").Reducer<any, any>' is not assignable to type '(reducer: import("/node_modules/easy-peasy/index").Reducer<any, any>) => import("/node_modules/easy-peasy/index").Reducer<any, any>'.
      Type 'Reducer<any, any>' is missing the following properties from type 'Reducer<any, any>': type, result  TS2345

_Originally posted by @alizahid in https://github.com/ctrlplusb/easy-peasy/issues/40#issuecomment-489314071_

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
revmischacommented, Jul 18, 2019

splendid thanks!

1reaction
ctrlplusbcommented, Jul 18, 2019

Fixed in easy-peasy@3.0.0-alpha.rc4.

Demo

Also, the v3 website has been updated. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Persisting your React application state with Redux and ...
Persisting your React application state with Redux and Typescript · Requirements · The state · Persisting reducers · Persisting the store · All...
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 >
rt2zz/redux-persist: persist and rehydrate a redux store - GitHub
Redux persist ships with react integration as a convenience. The PersistGate component is the recommended way to delay rendering until persistence is complete....
Read more >
@types/redux-persist examples - CodeSandbox
Learn how to use @types/redux-persist by viewing and forking @types/redux-persist example apps on CodeSandbox.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found