Add null guards

This commit is contained in:
Sakura Knoll
2023-07-11 02:58:24 +09:00 Unverified
parent 4f5055db69
commit 967363e48a
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -6,6 +6,9 @@ interface FormattedTextProps {
}
const FormattedText = ({ children }: FormattedTextProps) => {
if (children == null) {
children = ''
}
const tokens = tokenize(children)
return <>{renderTokens(tokens)}</>