Skip to content

Commit db849c9

Browse files
committed
fix: hydration warnings on glossary
wrap definition in span, preventing errors when attempting to nest certain elements such as `ul`, which are currently contained in some definitions.
1 parent 0cfdd7a commit db849c9

File tree

1 file changed

+7
-1
lines changed
  • src/components/Glossary/GlossaryDefinition

1 file changed

+7
-1
lines changed

src/components/Glossary/GlossaryDefinition/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ const GlossaryDefinition = ({ term, size = "md" }: GlossaryDefinitionProps) => {
2121
<OldHeading as="h3" lineHeight={1.4} id={term} {...headingStyles}>
2222
<Translation id={"glossary:" + term + "-term"} />
2323
</OldHeading>
24-
<Text {...textStyles}>
24+
{/**
25+
* `as="span"` prevents hydration warnings for strings that contain
26+
* elements that cannot be nested inside `p` tags, like `ul` tags
27+
* (found in some Glossary definition).
28+
* TODO: Develop a better solution to handle this case.
29+
*/}
30+
<Text as="span" {...textStyles}>
2531
<Translation id={"glossary:" + term + "-definition"} />
2632
</Text>
2733
</Box>

0 commit comments

Comments
 (0)