Context API 可以说是 React 中最有趣的一个特性了.一方面很多流行的框架(例如react-redux.mobx-react.react-router等)都在使用它:另一方面官方文档中却不推荐我们使用它.在 Context API 的文档中有下面这段话: The vast majority of applications do not need to use context. If you want your application to be stable, don’t use…
The React documentation has been warning us for a long time now that context shouldn't be used and that the API is unstable. Well, with the release of React 16.3, we're finally getting a stable context API and what's even better is that it has receiv…