UNPKG

@coocoon/react-awesome-query-builder

Version:

User-friendly query builder for React. Demo: https://ukrbublik.github.io/react-awesome-query-builder

12 lines (10 loc) 370 B
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> ]; };