@react-awesome-query-builder-dev/ui
Version:
User-friendly query builder for React. Core React UI
12 lines (10 loc) • 370 B
JSX
import React from "react";
export default ({value, setValue, label, id, config, type}) => {
const onChange = e => setValue(e.target.checked);
const postfix = type;
return [
<input key={id+postfix} type="checkbox" id={id+postfix} checked={!!value} onChange={onChange} />
,
<label key={id+postfix+"label"} htmlFor={id+postfix}>{label}</label>
];
};