Variable Input components
pnpm add @reactleaf/input
import TextInput from "@reactleaf/input/TextInput"
function YourComponent() {
const [value, setValue] = useState()
return <TextInput value={value} onValueChange={setValue} />
}
Install react-hook-form
pnpm add @reactleaf/input react-hook-form
import useForm, { FormProvider } from "react-hook-form"
import TextInput from "@reactleaf/input/TextInput/hookform"
function YourComponent() {
const form = useForm()
return (
<FormProvider {...form}>
<TextInput name="hook-form-name" />
</FormProvider>
)
}
Autocomplete and Combobox depends on react-select
and
DateInput depends on react-datepicker
.
pnpm add @reactleaf/input react-datepicker
import DateInput from "@reactleaf/input/DateInput"
function YourComponent() {
const [value, setValue] = useState()
return <DateInput value={value} onSelect={setValue} />
}