3 ms·
Why is that?
by spicyj 9y ago
Why is that?
- jhgg 9y agoDoesn't feel like it's needed. "getStateFromProps" would have been fine. I think any state "derivation" from props is implied.
- danabramov 9y agoWe 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.
- sibeliuss 9y agoThis naming choice makes sense now!