I'm in the process of integrating Redux into a React Native app. I'm having problems with how to pass Redux state through the NavigatorIOS component.
When execution enters the component shown below, the debugger shows
props = Object {state: undefined, actions: Object}
With the expected actions in the action object and still undefined, since it has not yet been initialized (suppose).
However, when execution enters the ItemIndex component, the debugger shows
props = Object {navigator: Object, route: Object}
My current implementation is trying to explicitly convey state and actions, but they cannot be pulled out: now the debugger shows
props = Object {navigator: Object, route: Object, state: null, actions: undefined}
class MainComponent extends Component {
constructor(props) {
super(props)
const { actions, state } = props
}
render() {
return (
<NavigatorIOS
ref = "nav"
style = {styles.navigator}
initialRoute = {{
passProps: { state: this.state, actions: this.actions },
title: 'Items',
component: ItemIndex
}}/>
)
}
}
module.exports = MainComponent
Is there a way to continue passing Redux state with NavigatorIOS?
source
share