fix mdx <S>
This commit is contained in:
parent
add93b2e3e
commit
9c9d3385c8
1 changed files with 4 additions and 1 deletions
|
@ -7,6 +7,9 @@ export function S<E extends React.ElementType='span'>({
|
|||
$?: string,
|
||||
_?: string,
|
||||
} & React.ComponentProps<E>) {
|
||||
const cls = [className, ...(modifier.match(/\.(\w+)/g) ?? [])].map(s => s.slice(1)).join(' ');
|
||||
const cls = [
|
||||
...(className ? [className] : []),
|
||||
...(modifier.match(/\.(\w+)/g) ?? []),
|
||||
].map(s => s.slice(1)).join(' ');
|
||||
return <TagName className={cls} {...props}>{children}</TagName>;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue