availity-reactstrap-validation
availity-reactstrap-validation copied to clipboard
Update input value of AvForm after a component mounted
Hi, thanks for developing and maintaining this repo
When using AvForm
the value of the form is set using the model={defaultValues}
right?
When the state is updated, how can we update the value of the from?
I think it is set the first time and once. Am I wrong?
So I have to do something like this.
<AvForm model={defaultValues}>
<AvField
name="title"
type="text"
label="عنوان"
value={defaultValues.title}
validate={{
required: { errorMessage: "این فیلد نباید خالی باشد" }
}}
/>
if I do not use value={defaultValues.title}
then the value is not updated after using componentDidMount
componentDidMount() {
this.getInfo(); // after calling this, value of AvForm should be updated, solution?
}
If you provide value
then you take control of the input. Similar to plain <input>
s within react. At that point, you have to listen for changes via onChange
and set the value when it changes.
The easy thing to do is just want for the defaults to load before showing the form.
is there any way to update form when model update? @TheSharpieOne
is there any way to update form when model update? @TheSharpieOne
Did u find a solution for this.
We dont have a solution for this?