availity-reactstrap-validation
availity-reactstrap-validation copied to clipboard
Uncaught (in promise) TypeError: Cannot read property 'validations' of undefined
Getting this issue when AvFields are rendered dynamically.
AvForm.js:525 Uncaught (in promise) TypeError: Cannot read property 'validations' of undefined
my code is as follows
<AvForm className='form-horizontal' onSubmit={this.handleSubmit}> {this.renderFormFeild()} {this.renderButton()} </AvForm>
renderFormFeild() function returned different form field as per current state and state get changed on radio outside the form. When i change any text in input field get this issue.
It sounds like you may be setting up your form fields wrong. Make sure you are using the name
prop when creating each input. That is the name that gets registered with the form validation context and returns all of those validations
that you are seeing as undefined.
@GoPro16 i have two type of form fields/input. Type 1 fields returned if state is true and Type 2 fields are returned if state is false.
In the DOM i can see the field with name attr. but on input focus/change it triggers error.
Can you please post a code sandbox link with your issue. There may just be some minor configuration you are doing wrong or its an edge case bug that I cannot seem to follow.
I'm also getting this err. It comes up when trying to insert a field into a form with another component:
const EVField = props_ => (
<AvField
type="number"
validate={{
min: { value: 0 },
max: { value: 252 }
}}
name={props_.name} />
);
<AvForm>
<EVField name="name" />
</AvForm>
I am getting the same error. It looks like it is coming the name.
I am using a form to create some array this way:
<AvField required type="date" name={'partialShipment[' + index + '][endOfProduction]'} id={'partialShipment[' + index + '][endOfProduction]'} />
and that seems to be the problem...
Hi,
anyone has a solution for it?
Anyone has a solution for it?
What happened to @JonoAugustine also happens to me.