1import React, { useState } from "react";import "./styles.css";
2
3export default function App() {
4 const [isActive, setActive] = useState("false");
5 const handleToggle = () => {
6 setActive(!isActive); };
7 return (
8 <div className={isActive ? "app" : null}> <h1>Hello react</h1>
9 <button onClick={handleToggle}>Toggle class</button> </div>
10 );
11}