import React, { useState } from 'react'; import { Button, Checkbox } from 'antd'; import type { CheckboxChangeEvent } from 'antd/es/checkbox'; const App: React.FC = () => { const [checked, setChecked] = useState(true); const [disabled, setDisabled] = useState(false); const toggleChecked = () => { setChecked(!checked); }; const toggleDisable = () => { setDisabled(!disabled); }; const onChange = (e: CheckboxChangeEvent) => { console.log('checked = ', e.target.checked); setChecked(e.target.checked); }; const label = `${checked ? 'Checked' : 'Unchecked'}-${disabled ? 'Disabled' : 'Enabled'}`; return ( <>
> ); }; export default App;