目的:为使嵌套在较深层的组件方便获取最外层组件信息,如user、session、主题等全局性的数据。

使用1:

react -- context
 
2.stateless组件中的使用
react -- context
 

 

相关文章: