react native modal swipe is not working with usenativedriver

Viewed 910

I use the libary react-native-modal. Can anyone explain me why my swipe not working If I use "useNativeDriver" to true? It goes away if I swipe but I dont see any swipe animation.

      <Modal
        isVisible={modalDeleteMessage}
        swipeDirection="down"
        onSwipeComplete={() => setModalDeleteMessage(false)}
        onBackButtonPress={() => setModalDeleteMessage(false)}
        onBackdropPress={() => setModalDeleteMessage(false)}
        animationOut="slideOutDown"
        useNativeDriver={true}
        backdropTransitionOutTiming={0}
        style={{margin: 0, padding: 0}}
      >
1 Answers

This issue tracker addresses this: https://github.com/react-native-community/react-native-modal/issues/163#issuecomment-409760695 enter image description here

Quote from the post:

This is not due to react native limitations. This is a problem because getLayout is being used which animates the left and top style properties of a view which are not supported by useNativeDriver. an alternative to getLayout exists called getTranslateTransform (See here) that animates translateX and translateY instead of top and left but since react-native-animatable animations are using those properties to pull off the in/out transitions and react-native-animatable will override the transform on the view when you try and set the transform explicitly this is not currently possible.

Related