react native how to call multiple functions when onPress is clicked

前端 未结 5 1798
离开以前
离开以前 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:12

    Recommended Solution:

        {
         function1();
         function2();
        }}>     
    

    You can use these props:

    onPress Called when the touch is released

    onPressIn Called as soon as the touchable element is pressed and invoked before onPress.

     {
          function1();
        }}
        onPressIn={() => {
          function2();
        }}
     >
     
    

提交回复
热议问题