Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Use native driver for the animation #387

Open
nes123 opened this issue Dec 17, 2019 · 4 comments
Open

Use native driver for the animation #387

nes123 opened this issue Dec 17, 2019 · 4 comments

Comments

@nes123
Copy link

nes123 commented Dec 17, 2019

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
}),

@Captain-ASCII
Copy link

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

@3plusalpha
Copy link

3plusalpha commented May 22, 2020

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.

@GleidsonDaniel
Copy link

@3plusalpha worked.
Tks

@sbrighiu sbrighiu mentioned this issue Jul 29, 2020
@dmantelli
Copy link

@3plusalpha worked !! Thanks you !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants