react add class if variable code example Example: add condition inside a className in reactjs className={`banner ${active ? "active" : ""}`}