Add null guards
This commit is contained in:
@@ -6,6 +6,9 @@ interface FormattedTextProps {
|
||||
}
|
||||
|
||||
const FormattedText = ({ children }: FormattedTextProps) => {
|
||||
if (children == null) {
|
||||
children = ''
|
||||
}
|
||||
const tokens = tokenize(children)
|
||||
|
||||
return <>{renderTokens(tokens)}</>
|
||||
|
||||
Reference in New Issue
Block a user