Lưu ý của Dan Abramov (tác giả của Redux).
Just because something is new, doesn’t mean you should use it!— Dan Abramov (@dan_abramov) April 12, 2018
Both getDerivedStateFromProps() and getSnapshotBeforeUpdate() are for rare use cases.
They’re new because we needed a migration strategy for legacy lifecycles. Not because we encourage using them widely. 🙂
Similarly, new context API is not an endorsement of using context everywhere instead of passing props. It’s just an API that solves the existing problem in a way that isn’t broken. It doesn’t mean you should start using context more.— Dan Abramov (@dan_abramov) April 12, 2018