Skip to content

Commit 0a3fc8f

Browse files
committed
call twmerge on className prop
1 parent 60bd7c0 commit 0a3fc8f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tsunami/frontend/src/vdom.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import clsx from "clsx";
55
import debug from "debug";
66
import * as jotai from "jotai";
77
import * as React from "react";
8+
import { twMerge } from "tailwind-merge";
89

910
import { Markdown } from "@/element/markdown";
1011
import { getTextChildren } from "@/model/model-utils";
@@ -203,6 +204,10 @@ function convertProps(elem: VDomElem, model: TsunamiModel): GenericPropsType {
203204
}
204205
continue;
205206
}
207+
if (key == "className" && typeof val === "string") {
208+
props[key] = twMerge(val);
209+
continue;
210+
}
206211
if (isObject(val) && val.type == VDomObjType_Func) {
207212
const valFunc = val as VDomFunc;
208213
props[key] = convertVDomFunc(model, valFunc, elem.waveid, key);

0 commit comments

Comments
 (0)