react-native-side-menu icon indicating copy to clipboard operation
react-native-side-menu copied to clipboard

Use native driver for the animation

Open nes123 opened this issue 4 years ago • 4 comments

It seems that a simple change will make this library much smoother

animationFunction: (prop, value) => Animated.spring(prop, { toValue: value, friction: 8, }),

goes to:

animationFunction: (prop, value) => Animated.spring(prop, { toValue: value, friction: 8, useNativeDriver: true }),

nes123 avatar Dec 17 '19 16:12 nes123

There is also a warning message with React-Native v0.62.2:

Animated: useNativeDriver was not specified. This is a required option and must be explicitly set to true or false

Captain-ASCII avatar May 03 '20 17:05 Captain-ASCII

If you see the warning message you can fix yourself like

<SideMenu
      animationFunction={(prop, value) =>
        Animated.spring(prop, {
          toValue: value,
          friction: 8,
          useNativeDriver: true,
        })
      }
/>

This is actually what's defined in the default props here but for some reason the warning still appears.

3plusalpha avatar May 22 '20 21:05 3plusalpha

@3plusalpha worked. Tks

GleidsonDaniel avatar Jun 04 '20 13:06 GleidsonDaniel

@3plusalpha worked !! Thanks you !

dmantelli avatar Aug 18 '20 19:08 dmantelli