Skip to content

Commit 92c24d8

Browse files
authored
Only render the Message body prop into a <p> element if it is a string (#452)
* Only render the Message body prop into a <p> element if it is a string
1 parent 2aaa3d0 commit 92c24d8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@terraware/web-components",
3-
"version": "2.4.0",
3+
"version": "2.4.1-rc.0",
44
"author": "Terraformation Inc.",
55
"license": "Apache-2.0",
66
"repository": {

src/components/Message/Message.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export default function Message(props: Props): JSX.Element | null {
3535
<h4>{title}</h4>
3636
</div>
3737
)}
38-
<p>{body}</p>
38+
39+
{typeof body === 'string' ? <p>body</p> : body}
40+
3941
{type === 'page' && pageButtons && pageButtons.length > 0 ? (
4042
<div className='tw-message--actions-container'>
4143
{pageButtons?.map((pageButton, index) => {

0 commit comments

Comments
 (0)