React native 为什么一个基本的react原生redux应用程序会抛出;a找不到存储错误“;
我正在尝试开始使用react native,在一个基本应用程序上出现以下错误React native 为什么一个基本的react原生redux应用程序会抛出;a找不到存储错误“;,react-native,redux,react-redux,React Native,Redux,React Redux,我正在尝试开始使用react native,在一个基本应用程序上出现以下错误 Could not find "store" in either the context or props of "Connect(App)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(App)". 尝试将移出应用程序组件 应该是这样的 <Prov
Could not find "store" in either the context or props of "Connect(App)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(App)".
尝试将
移出应用程序组件
应该是这样的
<Provider store={store}>
<App />
</Provider>
连接
依赖于
组件的上下文中的存储
// ./reducers/counter.js
export default (state = 0, action) => {
switch (action.type) {
case 'INCREMENT':
return state + 1
case 'DECREMENT':
return state - 1
default:
return state
}
}
<Provider store={store}>
<App />
</Provider>