How to add additional classes that gets styling from separate CSS file?

44 Views Asked by At

I'm utilising both react-bootstrap and JSS which might not be the best idea. But it is what is. Right now I'm trying to apply both some of the Bootstrap classes while also applying styling using JSS.

Is this possible? I can not seem to find any examples.

This is just a typical example of JSS

<div className={myStyle.someWrapper}></div>

and here's what I'm trying to do

<div className="{myStyle.someWrapper}, h-100"></div>

Does JSS support this?

1

There are 1 best solutions below

0
Krushna On

I am using clsx package. it is very useful for dynamic kinda scenario https://www.npmjs.com/package/clsx

you can pass object of classes, array of classes condition bases as well.

  1. For that install this package npm i clsx
  2. Import that import clsx from 'clsx'; // or import { clsx } from 'clsx';
  3. Use <div className={clsx(myStyle.someWrapper,"h-100")}></div>