Redux State Mutates unexpectedly
See original GitHub issue- Issue does not already exist /* As far as I can tell */
- Identify exactly what aspect your issue is about
- ignite base application
ignite doctor:
Computer
Platform: darwin
Ignite
Version: 1.5.0
Path: /usr/local/bin/ignite
Node
Version: v5.4.0
Path: /Users/christopherbradley/.nvm/versions/node/v5.4.0/bin/node
NPM
Version: 3.10.6
Path: /usr/local/bin/npm
Yeoman
Version: 1.8.4
React Native CLI
Version: 1.0.0
App
React Native Version: 0.31.0
Something seems to be destroying redux state. I’ve created a test example demonstrating the issue here: https://github.com/chrbradley/ingiteTestState/tree/add-new-state
In my example I modify the state in the StartUp saga and then MapStateToProps in the TestState component.
You can see that the state is present when the component initially renders, but something modifies the state which triggers a rerender of TestState component.
When the TestState component rerenders, the state is no longer there. Did I miss something when I created the new state object?
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Can a mutable object in Redux store that is only mutated ...
The mutable object is sometimes mutated outside of Redux, for example, by calling methods on the object itself. My question is, is this...
Read more >Common Error: Accidentally Mutating State in React
In React, the state is immutable. In simple terms it means that you should not modify it directly. Instead a new object should...
Read more >What Would Happen If You Mutated Your React Redux State?
Mutating your state would result in inconsistent UI. But besides that, there are some other consequences. It would break time-travel debugging, ...
Read more >Immutability in React and Redux: The Complete Guide
In React's case, it's important to never mutate state or props. Whether a component is a function or a class doesn't matter for...
Read more >Unexpected initial state mutation · Issue #49 - GitHub
The getStateFromCookies(initialState, paths) call will mutate initialState . In server-side rendering setting this leads to really bad stuff ...
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 Free
Top 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

Firiing the startup action like GantMan said is the solution at the moment and it works for me…
fixed by @lukabers in #379 - will be in next version’s release.