react if in class code example
Example 1: react conditional classname
<div className={`banner ${active ? "active" : ""}`}>{children}</div>
Example 2: add condition inside a className in reactjs
className={`banner ${active ? "active" : ""}`}
<div className={`banner ${active ? "active" : ""}`}>{children}</div>
className={`banner ${active ? "active" : ""}`}