'Validation text not showing up. MDBInput Reactjs
I am using Material design Bootstrap for my React project. I made a form, made input field using MDBInput. I am trying to use it's validation feature but I am not getting any message below it, when I leave the input field empty and click on the login button. I am getting red border though. Here is the image, highlighting the place where text should appear.
Here are the codes:
<MDBInput
label="Email"
type="email"
value={email}
name="email"
onChange={onInputChange}
required
invalid= {MDBInput.invalid}
validation= "Please provide your email"
/>
</div>
<div className="col-md-12">
<MDBInput
label="Password"
type="password"
value={password}
name="password"
onChange={onInputChange}
required
invalid= {MDBInput.invalid}
validation= "Please provide your password"
/>
</div>
Solution 1:[1]
I solved the error by downgrading the package to version 2.3.0 or 2.4.0. I think it might have something to do with the breaking changes.
You can downgrade using this following command
npm install [email protected]
# or
npm install [email protected]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Palm |

