Set Default Value on TextInput
Closed this issue · 1 comments
WenLonG12345 commented
Hi, I faced a problem where I cannot set a default value to the TextInput.
<FormBuilder
control={control}
setFocus={setFocus}
formConfigArray={[
{
name: 'text',
type: 'text',
defaultValue: 'erererere', <-- not working
rules: {
required: {
value: true,
message: 'Name is required',
},
},
textInputProps: {
text: '123'
},
},
]}
/>
Any idea what I had done wrongly? Thanks in advanced!
fateh999 commented
You can use useForm({
defaultValues:{
text: 'some value'
}
});