Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with redux-persist #38

Open
skoshy opened this issue Aug 23, 2019 · 7 comments
Open

Incompatibility with redux-persist #38

skoshy opened this issue Aug 23, 2019 · 7 comments

Comments

@skoshy
Copy link
Contributor

skoshy commented Aug 23, 2019

I'm trying to use immer-reducer with redux-persist, which adds its own _persist key to the state, but it fails with this error in the console.

image

Any ideas how to make the two work nicely together?

@skoshy skoshy changed the title Incompatility with redux-persist Incompatibility with redux-persist Aug 23, 2019
@esamattis
Copy link
Owner

Can you provide code replicating this error?

@yrral86
Copy link

yrral86 commented Dec 18, 2019

FYI, latest redux-persist (6.0.0) is working with immer for me. They've updated it to no longer mutate the state directly and instead make a new object as suggested in this ticket: rt2zz/redux-persist#747

@siarheipashkevich
Copy link

@yrral86 how you confirm that it's working correctly?

@yrral86
Copy link

yrral86 commented Apr 30, 2021

@siarheipashkevich
I was seeing the same error. I updated to redux-persist 6. The error went away. In version 6+ they no longer attempt to mutate the state.

@siarheipashkevich
Copy link

@yrral86 but in you case you can modify first level of the store directly.

@yrral86
Copy link

yrral86 commented May 3, 2021

@yrral86 but in you case you can modify first level of the store directly.

I don't know what you mean. I didn't provide any example code, so what do you mean by "in you case"? What are you trying to accomplish?

@siarheipashkevich
Copy link

@yrral86 can you please provide an example of code how you are using redux-persist? do you use code splitting for redux reducers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants