Earlier quoted context omitted.
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.
React v16.3.0: New lifecycles and context API
131–133 of 133 posts
Re: React v16.3.0: New lifecycles and context API
#132Earlier quoted context omitted.
Components are just functions -- HOC's are higher order functions. The pattern dropped out like all patterns drop out -- from use. Its nothing specific to React, but to functional programming
Just replied in the other spot -- I understand the similarities now, but I think this points to react still not being as simple as it could be -- if components were really as simple as being functions from state to UI, reacts API would be drastically smaller. My point is that it's not that simple (for better or for worse, some of the added complexity in the API IS essential IMO), but people still say things like "com…
Re: React v16.3.0: New lifecycles and context API
#133Earlier quoted context omitted.
For different reasons I don't use Redux that much in my app. The state is persisted in the url, or to be more precise React-Router's location. So let's say I have five different components on the page. All of them receive location and history as props. Each component updates the url separately, let's say a table updates the url with sort1=blah now the component needs to read this param compare next and current and fe…
I believe it's in the blog post: https://reactjs.org/blog/2018/03/27/update-on-async-renderin... (TLDR: Use `componentDidUpdate` for this.) Have you had a chance to skim through it?