use span if the value of the header label content is not string, to remove warnings from validateDomNesting
Signed-off-by: Morgan Bentell <mbentell@spotify.com>
This commit is contained in:
@@ -50,9 +50,16 @@ type HeaderLabelContentProps = {
|
||||
className: string;
|
||||
};
|
||||
|
||||
const HeaderLabelContent = ({ value, className }: HeaderLabelContentProps) => (
|
||||
<Typography className={className}>{value}</Typography>
|
||||
);
|
||||
const HeaderLabelContent = ({ value, className }: HeaderLabelContentProps) => {
|
||||
return (
|
||||
<Typography
|
||||
component={typeof value === 'string' ? 'p' : 'span'}
|
||||
className={className}
|
||||
>
|
||||
{value}
|
||||
</Typography>
|
||||
);
|
||||
};
|
||||
|
||||
type HeaderLabelProps = {
|
||||
label: string;
|
||||
|
||||
Reference in New Issue
Block a user