Skip to content

Commit

Permalink
fix(Text): Only apply elementType when RAC Text component is used. (#…
Browse files Browse the repository at this point in the history
…4270)

* fix(Text): Only apply `elementType` when RAC Text component is used.

* update snapshots

* Create dirty-flies-tan.md
  • Loading branch information
sebald authored Oct 30, 2024
1 parent 8892d06 commit 80a9f5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-flies-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marigold/components": patch
---

fix(Text): Only apply `elementType` when RAC Text component is used.
1 change: 0 additions & 1 deletion packages/components/src/Text/Text.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ test('get theme color', () => {
<div
class="text-[--color] outline-[--outline] font-["Oswald_Regular"]"
data-testid="text"
elementtype="div"
style="--color: rgb(5 150 105);"
/>
`);
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const _Text = ({
return (
<Component
{...props}
elementType={as}
elementType={props.slot ? as : undefined}
className={cn(
'text-[--color] outline-[--outline]',
classNames,
Expand Down

0 comments on commit 80a9f5b

Please sign in to comment.