📌  相关文章
📜  用于复选框检查和取消选中的 usestate 钩子 - Javascript 代码示例

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

代码示例1
const { useState } = React; // --> for inline use
// import React, { useState } from 'react';  // --> for real project


const App = () => {
  const [checked, setChecked] = useState(false)
  const handleClick = () => setChecked(!checked)
  
  return 
};


ReactDOM.render(, document.getElementById('root'))