react add class if code example Example: react conditional classname <div className={`banner ${active ? "active" : ""}`}>{children}</div>