Skip to content

Commit 5457a0d

Browse files
authored
WEB-90 Fix Paragraph giving <p> non-textual children (#99)
2 parents 33a2134 + 915f969 commit 5457a0d

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/components/puck/Paragraph.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ export const Paragraph: React.FC<ParagraphProps> = ({
1010
text,
1111
textColor = "text-black"
1212
}) => (
13-
<p className={textColor}>
14-
{text}
15-
</p>
13+
typeof text === "string"
14+
? (
15+
<p className={textColor}>
16+
{text}
17+
</p>
18+
)
19+
: (
20+
<div className={textColor}>
21+
{text}
22+
</div>
23+
)
1624
)
1725

1826
export const ParagraphConfig: ComponentConfig<ParagraphProps> = {

0 commit comments

Comments
 (0)