Hacker News new | ask | show | jobs
by spicyj 3007 days ago
Why is that?
1 comments

Doesn't feel like it's needed. "getStateFromProps" would have been fine. I think any state "derivation" from props is implied.
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.
This naming choice makes sense now!