mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
12 lines
376 B
JavaScript
12 lines
376 B
JavaScript
import React, {useContext} from 'react';
|
|
import {FieldId} from "ui/components/controls/Field";
|
|
|
|
export default function CheckboxControl(props) {
|
|
const {onChange, value} = props;
|
|
const fieldId = useContext(FieldId);
|
|
return <input id={fieldId}
|
|
type='checkbox'
|
|
checked={value}
|
|
onChange={e => onChange(e.target.checked)}/>
|
|
|
|
}
|