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:
JavaScript
x
25
25
1
<MDBInput
2
label="Email"
3
type="email"
4
value={email}
5
name="email"
6
onChange={onInputChange}
7
required
8
invalid= {MDBInput.invalid}
9
validation= "Please provide your email"
10
/>
11
</div>
12
13
<div className="col-md-12">
14
<MDBInput
15
label="Password"
16
type="password"
17
value={password}
18
name="password"
19
onChange={onInputChange}
20
required
21
invalid= {MDBInput.invalid}
22
validation= "Please provide your password"
23
/>
24
</div>
25
Advertisement
Answer
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
JavaScript
1
4
1
npm install mdb-react-ui-kit@2.3.0
2
# or
3
npm install mdb-react-ui-kit@2.4.0
4