Fixed content renderer crashing site if server render error occurs.
This commit is contained in:
parent
366e30268f
commit
4949e727bf
@ -99,6 +99,13 @@ const renderAnnotation = (textObject = {}, navigate, index) => {
|
|||||||
return textObject.text;
|
return textObject.text;
|
||||||
};
|
};
|
||||||
const renderText = (text = [], navigate) => {
|
const renderText = (text = [], navigate) => {
|
||||||
|
if (text.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (typeof text === "string" || typeof text === "number") {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
console.log("text", text, text.map);
|
||||||
return text.map((item, index) => {
|
return text.map((item, index) => {
|
||||||
return renderAnnotation(item, navigate, index);
|
return renderAnnotation(item, navigate, index);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user