D
D
dpdesigner2021-03-07 17:04:53
React
dpdesigner, 2021-03-07 17:04:53

How to easily update nested state fields in a react-redux app?

I use useReducer and Context from react in a small application.

The state is quite deep and updating it in the usual way is pretty mind-blowing.

An example of my state:

const state= [
    {
        name: '',
        lastName: '',
        nestedObj: [
            {
                field: ''
                anotherField: {
                    a,
                    b, 
                    c,
                    d
                }
            }
        ]
    }
]


What and how should I use to update deeply nested state fields? Now I ask for tools and examples of use with useReducer and context

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery, 2021-03-09
@dpdesigner

  • concept - concerns not only redax
  • decision

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question