renames
This commit is contained in:
@ -40,7 +40,7 @@ class ExampleForm extends React.Component {
|
||||
}
|
||||
|
||||
const [item, set] = useState({
|
||||
isactive: true,
|
||||
isActive: true,
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
@ -63,7 +63,7 @@ class ExampleForm extends React.Component {
|
||||
|
||||
|
||||
handleChange = ({ target }) => {
|
||||
if (target.name === "isactive") {
|
||||
if (target.name === "isActive") {
|
||||
set({ ...item, [target.name]: target.checked });
|
||||
} else if (target.name === "age") {
|
||||
set({ ...item, [target.name]: parseInt(target.value) });
|
||||
@ -100,8 +100,8 @@ class ExampleForm extends React.Component {
|
||||
<h3>{router.query?.id ? "Редактирай" : "Създай"} Item </h3>
|
||||
<div className="mb-4">
|
||||
<div className="form-check">
|
||||
<input className="checkbox" type="checkbox" id="isactive" name="isactive" onChange={handleChange} checked={item.isactive} autoComplete="off" />
|
||||
<label className="label" htmlFor="isactive">
|
||||
<input className="checkbox" type="checkbox" id="isActive" name="isActive" onChange={handleChange} checked={item.isActive} autoComplete="off" />
|
||||
<label className="label" htmlFor="isActive">
|
||||
Is Active</label>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user