From d3f625c0fc898c2a29c2b489a080242bd66ee46e Mon Sep 17 00:00:00 2001 From: Blindi Brasil <47512798+blindibrasil@users.noreply.github.com> Date: Mon, 20 Apr 2020 19:24:16 -0300 Subject: [PATCH] Set useNativeDriver to false explicitly in animation and reset I believe that the proposal submitted earlier does not fully solve the problem presented in version 0.62 of the RN. Because it is necessary to insert useNativeDriver in the function that resets the action. https://reactnative.dev/blog/2017/02/14/using-native-driver-for-animated#how-do-i-use-this-in-my-app --- ActionButton.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ActionButton.js b/ActionButton.js index ec1b9e3..630060d 100644 --- a/ActionButton.js +++ b/ActionButton.js @@ -254,7 +254,7 @@ const ActionButton = props => { if (active) return reset(animate); if (animate) { - Animated.spring(anim.current, { toValue: 1 }).start(); + Animated.spring(anim.current, { toValue: 1, useNativeDriver: false }).start(); } else { anim.current.setValue(1); } @@ -266,7 +266,7 @@ const ActionButton = props => { if (props.onReset) props.onReset(); if (animate) { - Animated.spring(anim.current, { toValue: 0 }).start(); + Animated.spring(anim.current, { toValue: 0, useNativeDriver: false }).start(); } else { anim.current.setValue(0); }