Search code examples
react-native-popup-menu

Is it possible to let SlideInMenu of react-native-popup-menu slide in from the right or left?


Standard Behaviour for react-native-popup-menu SlideInMenu renderer is to slide in from the bottom and slide out towards it again. Can this be changed to left or right?


Solution

  • Ok it is quite easy. You can just edit the

      transform: [{
        translateY: this.state.slide.interpolate({
          inputRange: [0, 1],
          outputRange: [oHeight, 0]
        }),
      }]
    

    in SlideInMenu.js and change the translateY to translateX. Or if you want to change directions accordingly change the values.

    I added a dynamic SlideInMenuDirection.js now for all my needs and registered it in the index.js.