in react-native app in App.js i use react-native-router-flux and connect each scene to store redux with "RouterWithRedux" as below:
export default class App extends Component {
render() {
const RouterWithRedux=connect()(Router);
return (
<Provider store={store}>
<RouterWithRedux>
<Scene key="root">
<Scene key="landing" component={Landing} title="Landing" initial={true}/>
<Scene key="pageTwo" component={PageTwo} title="PageTwo" />
<Scene
key="rootTabBar"
tabs={true}
tabBarStyle={{backgroundColor: '#ffffff'}}>
<Scene key="home" component={Home} title="Home" icon={TabIcon} initial />
<Scene key="search" component={Search} title="Search" icon={TabIcon} />
</Scene>
</Scene>
</RouterWithRedux>
</Provider>
)
}
}
export default App;
i want to use connect also App to redux to use "mapStateToProps" and "mapDispatchToProps" in app.js. how can i use this? i try
export default connect(mapStateToProps, mapDispatchToProps)(App);
but i faced with error that say:
Unhandled JS Exception: Could not find "store" in either the context or props of "Connect(App)". Either wrap the root component in a , or explicitly pass "store" as a prop to "Connect(App)".