Skip to content

Instantly share code, notes, and snippets.

@jogilvyt
Created June 20, 2022 09:53
Show Gist options
  • Save jogilvyt/0f585993bce92386ed646229bc32b2b8 to your computer and use it in GitHub Desktop.
Save jogilvyt/0f585993bce92386ed646229bc32b2b8 to your computer and use it in GitHub Desktop.
import React from "react";
const Toggle = () => {
const [isActive, setIsActive] = React.useState(false);
return (
<button onClick={() => setIsActive(!isActive)}>
{isActive ? "Active" : "Inactive"}
</button>
);
};
export default Toggle;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment