Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Created July 23, 2019 09:34
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/b38a9083da4f9683337bab38ca6216e5 to your computer and use it in GitHub Desktop.
Save koss-lebedev/b38a9083da4f9683337bab38ca6216e5 to your computer and use it in GitHub Desktop.
const Three = () => {
const [active, setActive] = React.useState(false);
return (
<motion.div
className="rectangle"
animate={
active
? { background: "#ff00b1", rotate: 90 }
: { background: "#0D00FF", rotate: 0 }
}
onClick={() => setActive(!active)}
>
Click me!
</motion.div>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment