get dynamic class from an component and set in react code example Example: dynsmic calss in react add className={`box ${isBoxVisible ? "" : "hidden"}`}