react-native-animatable icon indicating copy to clipboard operation
react-native-animatable copied to clipboard

onPress is not working with custom button component

Open sushmitg opened this issue 4 years ago • 1 comments

const DoneButton = ({onClick, animation, showDoneBtn}) => {
    return (
      <Animatable.View animation={animation} duration={150}>
          <ThemeButton
            buttonStyle={{...styles.doneBtnStyle, opacity: showDoneBtn ? 1 : 0}}
            icon={<Icon name="arrow-forward" color="#fff" size={24} />}
            onPress={onClick}
          />
      </Animatable.View>
    );
  };

my onClick function is not being called since I have wrapped the button in <Animatable.View>

sushmitg avatar Aug 12 '20 12:08 sushmitg

Same problem here.

The workaround I found is to have animation inside the element with an onPress.

<ThemeButton onPress={onClick}>
    <Animatable.View animation={animation} duration={150}>
        <Text>My text</Text>
    </Animatable.View>
<ThemeButton>

t1gu1 avatar Mar 05 '21 18:03 t1gu1