cx
A tiny helper function to conditionally join classnames. Simplified version of JedWatson's classnames and lukeed's clsx.
cx.ts
typescriptjavascript
export const cx = (...classes: (string | boolean | null | undefined)[]) =>
classes.filter(cls => typeof cls === 'string').join(' ')export const cx = (...classes) =>
classes.filter(cls => typeof cls === 'string').join(' ')