How to save only part of deeply nested state
See original GitHub issueHow do I save only the grandchild state in config? {keys: [{parent: {child: ['grandchild']}}]}
doesn’t seem to work
{
parent: {
child: {
grandchild: { ... }
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:9
Top Results From Across the Web
How to update nested state properties in React - Stack Overflow
Here is the Hookstate example, where the state is deeply / recursively nested in tree-like data structure. Save this answer. Show activity on...
Read more >Why is it so difficult to modify a deeply nested state in React?
The best solution is to avoid the problem. If you have a nested state, try to flatten it. Check out three main reasons...
Read more >Deeply Nested Objects and Redux | Pluralsight
First, came the component state and soon it was not enough to keep up with the increasing complexities of SPA (Single Page Applications)....
Read more >Nested state | Hookstate
We can dive to the deeply nested states of primitive values and set it, like we set the name property of a task...
Read more >Update nested properties in a State object in React | bobbyhadz
To update nested properties in a state object in React, pass a function to `setState` to get access to the current state object....
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
Doesn’t work for me.
My store looks like this:
and configuration:
As a result in localStorage i see the key
store-cache.parent
and its value is"{}"
What do i do wrong?
{keys: [{parent: [{child: ['grandchild', 'grandchild2'], 'parentProperty']}]}
Need that extra
[
array after parent I think