undefined is not an object (evaluating'(0,_reactNative.connect)(function(state){return{nav:state.nav};})') #15997
Labels
Ran Commands
One of our bots successfully processed a command.
Resolution: For Stack Overflow
A question for Stack Overflow. Applying this label will cause issue to be closed.
Resolution: Locked
This issue was locked by the bot.
Is this a bug report?
No
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v
:react-native-cli: 2.0.1
react-native:0.47.2
node -v
: v8.2.1npm -v
: 4.6.1yarn --version
:Then, specify:
Code:
import React, {Component} from 'react'
import {Provider, connect} from 'react-native'
import {StackNavigator, addNavigationHelpers} from 'react-navigation'
import Routes from './config/routes'
import getStore from './store'
const Navigator = StackNavigator(Routes, {
headerMode: 'none'
})
const navReducer = (state, action) => {
const newState = Navigator.router.getStateForAction(action, state)
return newState || state
}
class App extends Component {
render(){
return(
<Navigator
navigation={addNavigationHelpers({
dispatch: this.props.dispatch,
state: this.props.nav
})}
/>
)
}
}
const store = getStore(navReducer)
const AppIndex = connect( state => ({ nav: state.nav }) )(App)
export default Index = () => {
return (
<Provider store={store}>
<AppIndex />
</Provider>
)
}
The text was updated successfully, but these errors were encountered: