react native - Provider store can't be found in the context or props of Connect() -
i keep getting "could not find 'store' in either context or props of "connect(salesorderlist)" error. provide provider store can see in app.js file below. not sure error coming from. first attempt @ integrating redux react-native , i'm having trouble hooking together. experience please help. =)
my app.js
const store = createstore(reducers, window.__redux_devtools_extension__ && window.__redux_devtools_extension__(), applymiddleware(thunk)); console.log(store.getstate()); export default class app extends component { constructor(props) { super(props); this.state = {}; } state = { loggedin: null}; renderview() { switch (this.state.loggedin) { case true: return <appnavigator /> case false: return <login />; default: return <appnavigator />; } } render() { return ( <provider store={store}> <view style={styles.container}> {this.renderview()} </view> </provider> ); } }
index.ios.js
import { appregistry, } 'react-native'; import app './src/components/app'; import { stacknavigator } 'react-navigation'; import salesorderlist './src/components/salesorderlist'; import salesorderitem './src/components/salesorderitem'; const appnavigator = stacknavigator({ salesorderlist : { screen: salesorderlist }, salesorderitem : { screen: salesorderitem } }); appregistry.registercomponent('issicrm', () => appnavigator); export default appnavigator;
so registering appnavigator
component in index.ios.js: appregistry.registercomponent('issicrm', () => appnavigator);
.
if closely, appnavigator
component linking stacknavigator component, not connected redux store @ all, why seeing error within salesorderlist
component's connect call.
i think wanted register app
component in index.ios.js, because imported have never used it.
Comments
Post a Comment