Skip to content

Commit f5648d2

Browse files
committed
chore: rollback to refactored version
1 parent cf2ac0c commit f5648d2

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

src/Tag.tsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ export const Tag = memo(
183183
)}
184184
{linkProps === undefined &&
185185
nativeButtonProps === undefined &&
186-
AsTag === "p" && (
187-
<p
186+
(AsTag === "span" || AsTag === "p") && (
187+
<AsTag
188188
{...nativeParagraphOrSpanProps}
189189
id={id_props ?? nativeParagraphOrSpanProps?.id ?? id}
190190
className={cx(nativeParagraphOrSpanProps?.className, className)}
@@ -197,25 +197,7 @@ export const Tag = memo(
197197
{...rest}
198198
>
199199
{children}
200-
</p>
201-
)}
202-
{linkProps === undefined &&
203-
nativeButtonProps === undefined &&
204-
AsTag === "span" && (
205-
<span
206-
{...nativeParagraphOrSpanProps}
207-
id={id_props ?? nativeParagraphOrSpanProps?.id ?? id}
208-
className={cx(nativeParagraphOrSpanProps?.className, className)}
209-
style={{
210-
...nativeParagraphOrSpanProps?.style,
211-
...style
212-
}}
213-
title={title ?? nativeParagraphOrSpanProps?.title}
214-
ref={ref as React.ForwardedRef<HTMLSpanElement>}
215-
{...rest}
216-
>
217-
{children}
218-
</span>
200+
</AsTag>
219201
)}
220202
</>
221203
);

0 commit comments

Comments
 (0)