Skip to content

Instantly share code, notes, and snippets.

const data = Data({ left: Animatable(2), color: "#999" });
let isToggleOn = false;
export const Toggle: Override = () => {
return {
left: data.left,
background: data.color,
onTap() {
let leftValue = isToggleOn ? 2 : 28;
animate.easeOut(data.left, leftValue, { duration: 0.25 });
data.color = isToggleOn ? "#999" : "#1199EE";
isToggleOn = !isToggleOn;
}
};
};
@codeplusux
Copy link

I will try. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment