Selector
Usage
Instalar dependencias
Requiere instalar el módulo @react-native-picker/picker
> 2.5.1
npm i @react-native-picker/picker
import {FormController} from '@rn-punikit/base'
import {useForm} from 'react-hook-form'
export default () => {
const {control} = useForm({
defaultValues: {
category: '',
},
})
return (
<FormController
type={'selector'}
control={control}
fieldId={'category'}
fieldConfig={{
label: 'Nombre',
}}
/>
)
}
Props
FormOptionPickerConfig
Tipo | description | Tipo |
---|---|---|
options | Label del campo | Array< FormOptionPickerValue > |
Tipos
FormOptionPickerValue
Tipo | description | Tipo |
---|---|---|
name | Label del campo | string |
value | Valor del campo | string |