-
className={twMerge('p-4', {'p-0': yes, 'p-9': no})} Here is my workaround: import cn, { Argument } from 'classnames';
import { twMerge } from 'tailwind-merge';
/**
* Works just like `twMerge`, but uses built-in `classNames`.
*
* @param classNames
* @returns
*/
export function cnMerge(...classNames: Argument[]) {
return twMerge(cn(classNames));
} Does my workaround effect the cache behavior? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Hey @meness! 👋 Yeah I thought about it many times but inlining classnames or clsx would be the same as your approach in the workaround. The only difference is that people who don't want the bundle size increase of the classnames package would be forced to use it because it is included in the package. The caching behavior won't get affected by your workaround. Is there a reason why you'd prefer to have the argument types of classnames in tailwind-merge instead of using the workaround? Are you using Tailwind CSS with the default config? But I'll think about it, maybe it I should really include it. |
Beta Was this translation helpful? Give feedback.
Issue → #124