React-native-router-flux: undefined is not a function (evaluating '_reactNativeRouterFlux.Actions.guideHomePage()') _onPress

Created on 10 Jan 2018  ·  2Comments  ·  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.27 (v3 is not supported)
  • react-native v0.51.0

My RouteConfig

const reducerCreate = params => {
    const defaultReducer = new Reducer(params)
    return (state, action) => {
        console.log('ACTION:', action)
        return defaultReducer(state, action)
    }
}

const RootPage = () => (
    <Router
        createReducer={reducerCreate}>
        <Stack key='root'>
            <Scene key='loginHomePage' component={LoginHomePage} title='Login'/>
            <Scene ket='guideHomePage' component={GuideHomePage} title='Guide'/>
            <Scene key='personHomePage' component={PersonHomePage} title='PersonInfo'/>
            <Scene key='caculateSum' component={CaculateSum} title='HomeWork'/>
        </Stack>
    </Router>

)

Expected behaviour

1、Jump from LoginHomePage to GuideHomePage
not ok
the error like this:undefined is not a function (evaluating '_reactNativeRouterFlux.Actions.guideHomePage()')
_onPress

2、Jump from LoginHomePage to PersonHomePage
ok

3、Jump from LoginHomePage to CaculateSum
ok

4、Jump from PersonHomePage to LoginHomePage or GuideHomePage
not ok
the error like this:undefined is not a function (evaluating '_reactNativeRouterFlux.Actions.guideHomePage()')
_onPress

other,LoginHomePage and GuideHomePage are similar,just like this:

` _onPress = () => {
Actions.guideHomePage()
}

render() {
    return (
        <View style={styles.container}>
            <TouchableNativeFeedback onPress={this._onPress}>
                <Text style={styles.text}>Jump to GuidePage</Text>
            </TouchableNativeFeedback>
        </View>
    )
}`

besides,PersonHomePage and CaculateSum are created ealier than the others

Actual behaviour

Most helpful comment

Because you wrote "ket" instead of "key" in your Router

All 2 comments

image
I did not find the function guideHomePage in Actions when debugging

Because you wrote "ket" instead of "key" in your Router

Was this page helpful?
0 / 5 - 0 ratings