box-ui-elements-mlh
Version:
17 lines (11 loc) • 420 B
Flow
// @flow
import * as React from 'react';
import type { FieldProps } from 'formik';
import CheckboxPrimitive from './Checkbox';
import type { CheckboxProps } from './Checkbox';
type Props = CheckboxProps & FieldProps;
const CheckboxField = ({ field, form, ...rest }: Props) => {
const { value } = field;
return <CheckboxPrimitive {...field} {...rest} isChecked={!!value} />;
};
export default CheckboxField;