程序员周末英语
Usually, you will pass information from a parent component to a child component via props. But passing props can become verbose and inconvenient if you have to pass them through many components in the middle, or if many components in your app need the same information. Context lets the parent component make some information available to any component in the tree below it—no matter how deep—without passing it explicitly through props.

通常,父组件通过props传递属性信息给子组件,但是如果通过这种方法需要不断的传递很中间组件的话,就变的非常冗余,Context 让父组件能够传递信息给组件树上的任意组件,无论层级多深,不用通过props显示传递
展开
评论