You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the end, there is a confusing explanation about "Duplicated data from props" in the section "What Shouldn’t Go in State?":
Duplicated data from props: Try to use props as the source of truth where possible. Because props can change over time, it's appropriate to store props in state to be able to know its previous values.
Perhaps what is trying to be said is something like:
Duplicated data from props: Try to use props as the source of truth where possible. One valid use to store props in state is to be able to know it's previous values, because props can change over time.
The text was updated successfully, but these errors were encountered:
it's appropriate to store props in state to be able to know its previous values.
Ah, perhaps what they're really referring to is basically "edit pages", where you might want to diff the before and after, so that you can send only the changed variables. But it really reads quite weirdly, especially for beginners.
This change is needed. I'm new to React and just did a Google search on that part of the documentation for clarification and it came up with this page. I'm guessing that what you've interpreted it to mean is correct, as it makes sense that way.
http://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html
At the end, there is a confusing explanation about "Duplicated data from props" in the section "What Shouldn’t Go in State?":
Perhaps what is trying to be said is something like:
The text was updated successfully, but these errors were encountered: