usestate hook for checkbox check and uncheck code example
Example: usestate hook for checkbox check and uncheck
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'))