Redux 找不到“;商店「;在「;连接(组件)“;,尽管传递了提供程序和上下文

Redux 找不到“;商店「;在「;连接(组件)“;,尽管传递了提供程序和上下文,redux,react-redux,Redux,React Redux,在React应用程序中使用Redux时,许多其他问题通过提醒用户应将容器组件包装在提供程序或根组件中,或将特定上下文作为选项传递给连接,从而解决了在…上下文中找不到“存储”的问题。我正在做所有这些,只有当我单独包装一个容器组件时它才起作用。。。而我希望提供程序包装根组件。问题是什么 版本 react: 16.13.1 redux: 4.0.5 react-redux: 7.2.0 index.jsx const-store=createStore(reducer,state); const c

在React应用程序中使用Redux时,许多其他问题通过提醒用户应将容器组件包装在提供程序或根组件中,或将特定上下文作为选项传递给连接,从而解决了
在…
上下文中找不到“存储”的问题。我正在做所有这些,只有当我单独包装一个容器组件时它才起作用。。。而我希望提供程序包装根组件。问题是什么

版本

react: 16.13.1
redux: 4.0.5
react-redux: 7.2.0
index.jsx

const-store=createStore(reducer,state);
const context=React.createContext(未定义);
渲染(
,
document.getElementById(“应用程序”)
);
ContainerComponent.jsx呈现在
App
组件内部的某个地方

export const container component=connect(
MapStateTops,
mapDispatchToProps,
无效的
{context}
)(MyComponent);
错误

Uncaught Error: Could not find "store" in the context 
of "Connect(MyComponent)". Either wrap the root component
in a <Provider>, or pass a custom React context provider
to <Provider> and the corresponding React context consumer
to Connect(MyComponent) in connect options.
未捕获错误:在上下文中找不到“存储”
“连接(MyComponent)”的。或者包装根组件
在中,或传递自定义的React上下文提供程序
到和相应的React上下文使用者
在连接选项中连接(MyComponent)。

=>不过都完成了

自定义上下文参数仅用于非常罕见的用例。你不应该正常使用它


删除该代码。

自定义上下文参数仅用于非常罕见的用例。你不应该正常使用它


删除该代码。

我添加它们是因为它在没有不幸的情况下也会失败。我添加它们是因为它在没有不幸的情况下也会失败。