diff --git a/src/Helmet.js b/src/Helmet.js index 7474e5d5..b35c3416 100644 --- a/src/Helmet.js +++ b/src/Helmet.js @@ -187,7 +187,13 @@ const Helmet = (Component) => class HelmetWrapper extends React.Component { return warn(`Only elements types ${VALID_TAG_NAMES.join(", ")} are allowed. Helmet does not support rendering <${child.type}> elements. Refer to our API for more information.`); } - if (nestedChildren && typeof nestedChildren !== "string") { + if ( + nestedChildren && + typeof nestedChildren !== "string" && + ( + !Array.isArray(nestedChildren) || nestedChildren.some(nestedChild => typeof nestedChild !== "string") + ) + ) { throw new Error(`Helmet expects a string as a child of <${child.type}>. Did you forget to wrap your children in braces? ( <${child.type}>{\`\`} ) Refer to our API for more information.`); } } diff --git a/src/HelmetUtils.js b/src/HelmetUtils.js index 6f4e1e13..54cad57e 100644 --- a/src/HelmetUtils.js +++ b/src/HelmetUtils.js @@ -301,8 +301,8 @@ const handleClientStateChange = (newState) => { }; const updateTitle = (title, attributes) => { - if (typeof title === "string" && document.title !== title) { - document.title = title; + if (typeof title !== "undefined" && document.title !== title) { + document.title = Array.isArray(title) ? title.join("") : title; } updateAttributes(TAG_NAMES.TITLE, attributes);