Conditional Classes in React
Same problem, class-list angle. A tiny cx helper: parts.filter(Boolean).join(' ') turns ('tab', on && 'tab-on') into 'tab tab-on' or 'tab'. That’s what clsx does. Use it when you have three flags (disabled, active, error).
Conditional Classes in React — output — "tab tab-on" then "tab". Libraries like clsx do this.
Exam tip
cx / clsx for several flags.