react native how to call multiple functions when onPress is clicked

前端 未结 5 1789
离开以前
离开以前 2021-02-05 05:35

I am trying to call multiple functions when I click onPress using TouchableOpacity

For example:

functionOne(){
// do something
         


        
5条回答
  •  情书的邮戳
    2021-02-05 06:28

    Seeking your comment, you want to not used arrow, so I'm suggest to use something like this:

    functionOne(){
    // do something
    }
    
    functionTwo(){
    // do someting
    }
    
    mixFunction=()=>{
    functionOne();
    functionTwo();
    }
    
    mixFuncWithoutArrow(){
    functionOne();
    functionTwo();
    }
    
    
    

提交回复
热议问题