Open
Description
We used to have a "tip" about this on the old website (a few years ago), but not anymore.
I think maybe we need to revive that section because too many people attempt to derive state from props—either in constructor or cWRP—without realizing they could just do this work in render. In 90% of cases that's exactly what they need to do.
See also https://mobile.twitter.com/EntriaTech/status/934139022204653569.
Activity
jyash97 commentedon Nov 24, 2017
Hey @gaearon can I take this? Could you tell what to we need to add ?
alexkrolick commentedon Nov 24, 2017
@jyash97 the issue is yours!
I've added an "in-progress" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim.
As far as what to add, how about starting with a disclaimer in State and Lifecycle and FAQ: State?
jyash97 commentedon Nov 25, 2017
#341
Hey @alexkrolick I have done the changes, please have a look at it
bvaughn commentedon Nov 29, 2017
Hey @jyash97. The outcome of #341 didn't actually end up related to this issue, but rather to #351, so I'm going to mark this issue as no longer in progress. If you'd like to send another PR that implements the suggestion from this issue though, let us know and we'll mark it back in progress. 😄
jyash97 commentedon Nov 30, 2017
@bvaughn
Can you have a look at the first commit of #341, I added topics like what should come in State, is this the good way of tackling this issue?
bvaughn commentedon Nov 30, 2017
At a glance the section "What Shouldn’t Go in State?" seems like what this issue is asking for.
jyash97 commentedon Nov 30, 2017
Okay let me try one more time to update this content
bvaughn commentedon Dec 4, 2017
I think that's just another explanation of why state and props are different but this issue is asking for more of a warning about why syncing props to state is generally unnecessary.
6 remaining items