Re:React v16.3.0: New lifecycles and context API
by jhgg on Friday March 30, 2018 @03:18AM
(#16714333)
Doesn't feel like it's needed. "getStateFromProps" would have been fine. I think any state "derivation" from props is implied.
[ Parent
| on HN ]
Re:React v16.3.0: New lifecycles and context API
by danabramov on Friday March 30, 2018 @04:36AM
(#16714640)
We intentionally made the naming a little bit obtuse. A name like `getStateFromProps` implies this is a common operation because it sounds so “normal”. And this is, in fact, a common misconception with React beginners who try to copy props into state instead of using props directly or lifting state up. So we wanted the naming to reflect that this pattern is not supposed to be the most common.