import React , { useState } from 'react' ; import { CheckBox } from '../basic/checkbox' ; export const BooleanValueEditor = ( props ) => { const { value , defaultValue , onValueChange , ... rest } = props ; const [ delegate , setDelegate ] = useState < { value : boolean ; } > ( { value : value || defaultValue || false } ) ; const onPropChange = ( value ) => { onValueChange ( value ) ; setDelegate ( { value } ) ; } ; return < CheckBox { ... rest } value = { delegate . value } onChange = { onPropChange } / > ; } ;