Skip to content

Instantly share code, notes, and snippets.

@chaance
Created September 21, 2020 01:11
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaance/619a3c54a8fcb80bc896f1dd0580ce2f to your computer and use it in GitHub Desktop.
Save chaance/619a3c54a8fcb80bc896f1dd0580ce2f to your computer and use it in GitHub Desktop.
/**
* @typedef {Object} ClassifyProps
* @property {React.ElementType} [as] - Element to render
* @property {import('clsx').ClassValue} [className] - Composable classnames passed to clsx
*/
/**
* @param {ClassifyProps} props
*/
function Classify({ as: El = "div", ...props }) {
return <El {...props} className={clsx(props.className)} />;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment