📜  反应切换类 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:38.943000             🧑  作者: Mango

代码示例1
// You Should pass props to main functions and import useState
const [isActive, setActive] = useState(false);
const toggleClass = () => {
    setActive(!isActive);
  };