1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-24 01:18:01 +02:00

chore: fix invalid dom nesting ()

This PR fixes all `invalidDomNesting` errors we're getting in our tests.
The culprit was the `Badge` icon we use, which wrapped its children in a
div. When that's used as a child of a `p` tag, that'd cause this to
trigger.

What I've done is to change the wrapping element to a span instead. The
Badge itself uses an `display: inline-flex`, so divs and spans should be
treated the same, meaning there's no visual change for this.
This commit is contained in:
Thomas Heartman 2024-10-16 08:33:47 +02:00 committed by GitHub
parent 8d4e84d6eb
commit 6ba87d1436
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,7 +120,7 @@ export const Badge: FC<IBadgeProps> = forwardRef(
children !== undefined && children !== undefined &&
children !== '' children !== ''
} }
show={<div>{children}</div>} show={<span>{children}</span>}
/> />
<ConditionallyRender <ConditionallyRender
condition={Boolean(icon) && Boolean(iconRight)} condition={Boolean(icon) && Boolean(iconRight)}