Answer the question
In order to leave comments, you need to log in
How to replace nested state in react and why is it bad?
Perhaps I misunderstand the nested state, but I understand that this is an object of this kind:
state = {
phone: {
countryCode,
number
}
}
Answer the question
In order to leave comments, you need to log in
This is not bad, it's just not very convenient to update nested objects, I try to separate components and states whenever possible so that nested objects do not have to be stored.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question