Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actions[type] is not a function #2070

Closed
pengyanb opened this issue Jul 19, 2017 · 3 comments
Closed

actions[type] is not a function #2070

pengyanb opened this issue Jul 19, 2017 · 3 comments

Comments

@pengyanb
Copy link

pengyanb commented Jul 19, 2017

I am having issue with version 4.0.0-beta.11 (I used Version 3.38.0 with my previous project, things were all working fine).

Anyway, here is the basic structure:

          <Provider store={store}>
                <Router wrapBy={connect()}>
                    <Scene key="root">
                        <Scene key="MenuScene" 
                            component={MenuScene} 
                            title="Menu" 
                            hideNavBar={true} 
                            initial={true}
                            type={ActionConst.RESET}>
                        </Scene>
                        <Scene key="GameScene"
                            component={GameScene}
                            title="Game"
                            hideNavBar={true}
                            type={ActionConst.RESET}>
                        </Scene>
                    </Scene>
                </Router>
            </Provider>

The initial scene looks like this:

class MenuScene extends React.Component{
    render(){
        return(
            <View>
                <StatusBar hidden={true}></StatusBar>
                <Text>This is MenuScene</Text>
                <TouchableOpacity
                    onPress={()=>{
                        console.log("Actions", Actions);
                        Actions.GameScene();
                    }}><Text>Go to Game Scene</Text></TouchableOpacity>
            </View>
        );
    }
}

Clicking on the TouchableOpacity gives me an "actions[type] is not a function" error.

screen shot 2017-07-19 at 21 37 57

I did a console.log to inspect the "Actions", here is what I get in console:
screen shot 2017-07-19 at 21 40 17

Anyone can see why I am getting the error? Thanks.

@quarryman
Copy link

might be duplicate of closed one
#2017

@aksonov
Copy link
Owner

aksonov commented Jul 19, 2017

Please check master now, I've added backward compatibility to use constants.

@aksonov aksonov closed this as completed Jul 19, 2017
@pengyanb
Copy link
Author

@aksonov It worked after I use 'reset' as parameter last night. I Will pull from master tonight. Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants