Skip to content
Advertisement

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.

enter image description here

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>

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

npm install mdb-react-ui-kit@2.3.0
# or
npm install mdb-react-ui-kit@2.4.0
Advertisement