Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed useNativeDriver error #354

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ActionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ const ActionButton = props => {

useEffect(() => {
if (props.active) {
Animated.spring(anim.current, { toValue: 1 }).start();
Animated.spring(anim.current, { toValue: 1,useNativeDriver:false }).start();
setActive(true);
setResetToken(props.resetToken);
} else {
props.onReset && props.onReset();

Animated.spring(anim.current, { toValue: 0 }).start();
Animated.spring(anim.current, { toValue: 0,useNativeDriver:false }).start();
timeout.current = setTimeout(() => {
setActive(false);
setResetToken(props.resetToken);
Expand Down Expand Up @@ -148,8 +148,8 @@ const ActionButton = props => {
onPressIn={props.onPressIn}
onPressOut={props.onPressOut}
>
<Animated.View style={wrapperStyle}>
<Animated.View style={[buttonStyle, animatedViewStyle]}>
<Animated.View style={wrapperStyle} >
<Animated.View style={[buttonStyle, animatedViewStyle]}>
{_renderButtonIcon()}
</Animated.View>
</Animated.View>
Expand Down Expand Up @@ -178,6 +178,7 @@ const ActionButton = props => {

return (
<Animated.Text

style={[
styles.btnText,
buttonTextStyle,
Expand Down Expand Up @@ -254,7 +255,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);
}
Expand All @@ -266,7 +267,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);
}
Expand All @@ -281,6 +282,7 @@ const ActionButton = props => {
return (
<View pointerEvents="box-none" style={[getOverlayStyles(), props.style]}>
<Animated.View

pointerEvents="none"
style={[
getOverlayStyles(),
Expand Down