How to use Classname in react to give Bootstrap class and CSS file style in same "Classname" field

27 Views Asked by At
<div class="form-group" className=''>
    <input type="password" class="form-control" className={loginStyle.passwordDiv} 
           id="exampleInputPassword1" placeholder="Password"></input> 
</div>

I want to pass class form-control and also need to use loginStyle which I imported from another CSS file to provide styling to this input.

1

There are 1 best solutions below

0
melodyxpot On

You will need to use both class names in className like this in your case

<div className="form-group">
  <input 
    type="password"
    className={`${loginStyle.passwordDiv} form-control`} 
    id="exampleInputPassword1" 
    placeholder="Password" 
  /> 
</div>