MathiasGilson/Tailwind-Styled-Component

Enhancement: export twMerge

alexjidras opened this issue · 2 comments

you could export twMerge function from 'tailwind-merge' as part of this package. So we don't have to install 'tailwind-merge' as a separate package when tailwind-styled-components already comes with it.

Thoughts on syntax:

import tw, { twMerge } from 'tailwind-styled-components';

or

import tw from 'tailwind-styled-components';

// usage:

tw.merge('pl-4', undefined, false, props.className)

My humble opinion:

I don't see everybody that uses tailwind-styled-components with a mandatory need of tailwind-merge, so if it is a special case it should be add as dependency when needed only.

Also, libraries should be a black box, in case the author needs to chance the internal implementation it would broken whoever is using that internal dependency.

@rubens-lopes Good argument. Thanks