Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Last active July 23, 2019 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koss-lebedev/fb57e8f71b09875b421a381ba18c1546 to your computer and use it in GitHub Desktop.
Save koss-lebedev/fb57e8f71b09875b421a381ba18c1546 to your computer and use it in GitHub Desktop.
const Five = () => {
const container: Variants = {
active: {
background: "#ff00b1"
},
disabled: {
background: "#0D00FF"
}
};
const [active, setActive] = React.useState(false);
return (
<motion.div
variants={container}
animate={active ? "active" : "disabled"}
onClick={() => setActive(!active)}
className="container"
>
{[0, 1, 2].map(value => (
<div key={value} className="box" />
))}
</motion.div>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment