Skip to content

Instantly share code, notes, and snippets.

@teeparham
Last active January 17, 2024 18:15
Show Gist options
  • Save teeparham/fe596755c50059160bce446e2c689f74 to your computer and use it in GitHub Desktop.
Save teeparham/fe596755c50059160bce446e2c689f74 to your computer and use it in GitHub Desktop.
classnames & clsx replacement
// https://dev.to/gugaguichard/replace-clsx-classnames-or-classcat-with-your-own-little-helper-3bf
export function cx(...args: unknown[]) {
return args
.flat()
.filter((x) => typeof x === "string")
.join(" ")
.trim();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment