Skip to content

undefined is not an object (evaluating'(0,_reactNative.connect)(function(state){return{nav:state.nav};})') #15997

@jctadios

Description

@jctadios

Is this a bug report?

No

Have you read the Contributing Guidelines?

Yes

Environment

  1. react-native -v:
    react-native-cli: 2.0.1
    react-native:0.47.2
  2. node -v: v8.2.1
  3. npm -v: 4.6.1
  4. yarn --version:

Then, specify:

  • Target Platform: Andriod
  • Development Operating System: windows 7 ultimate version 6.1
  • Build tools: Expo

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>
)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions