-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EuiStat] Allow customizing the render of the title and description HTML tags #3676
Comments
Regarding the error, I thought that might be the case. EuiStat is pretty prescriptive with the elements it renders because they're being wrapped in EuiTitle and EuiText components which should be some level of text element (heading, paragraph, etc). We will need to support some level of customizing these elements instead of just replacing the Action item:Add props like |
If an element other than a eui/src/components/stat/stat.tsx Lines 139 to 141 in c19ca9f
|
@cchaos The description just straight out displays the text written inside it, could you guide me as to how to reproduce the bug.
|
Check the console for a warning |
|
You passed the component as
|
The error occurs when in the Stat component in the description you add something other than plain text, for example I include my own component, doing this generates a
<div>
tag inside a<p>
, for example:This produces a problem with React validation, to be more exact it shows this warning in console:
Warning: validateDOMnesting (...): <div> cannot appear as a descendant of <p>.
Modifying the
<p>
tags by<span>
fixes this error and so you can use custom components, even other Eui components within stats.Originally posted by @victorst79 in #3673 (comment)
The text was updated successfully, but these errors were encountered: