[英]What is the context instance prop of react-redux provider?
I was reading about React-Redux provider in the library docs and i faced 'context instance' prop as one prop for the provider, i couldn't really understand what it means:我正在图书馆文档中阅读有关React-Redux 提供者的信息,我遇到了“上下文实例”道具作为提供者的一个道具,我无法真正理解它的含义:
context You may provide a context instance. If you do so, you will need to provide the same context instance to all of your connected components as well. Failure to provide the correct context results in runtime error:
Is it the whole store data??是全店数据吗?? the destination component of data??数据的目标组件??
Is it the whole store data??是全店数据吗?? the destination component of data??数据的目标组件??
No, the context
props is a react context instance, which allow you using store
directly in its consumer instead of through connect
, useSelector
or useStore
.不, context
道具是一个反应上下文实例,它允许您直接在其消费者中使用store
,而不是通过connect
、 useSelector
或useStore
。 As its doc, you can either create your custom context or using redux's ReactReduxContext
作为其文档,您可以创建自定义上下文或使用 redux 的ReactReduxContext
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.