mirror of
https://github.com/zhigang1992/nativewind.git
synced 2026-06-15 10:17:54 +08:00
fix: merging classes of styled(styled()) components
This commit is contained in:
@@ -22,7 +22,7 @@ export function useTailwind<
|
||||
) => {
|
||||
return flatten
|
||||
? classNameToInlineStyle(className, useTailwindOptions)
|
||||
: { $$css: true, tailwindClassName: className };
|
||||
: { $$css: true, [className]: className };
|
||||
}) as UseTailwindCallback<P>;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ export function withStyledProps<S, T extends string>({
|
||||
if (typeof value === "string") {
|
||||
if (preview) {
|
||||
styledProps[prop] = undefined;
|
||||
(mainStyles as unknown as Record<string, unknown>)[prop] = (
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
mainStyles[prop as any] = Object.values(
|
||||
tw(value, {
|
||||
flatten: false,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
}) as any
|
||||
).tailwindClassName;
|
||||
})
|
||||
)[1];
|
||||
} else {
|
||||
const entries = Object.entries(tw(value, { flatten: true }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user