You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
I'm using rapscallion and am using helmet to render a title and meta description (see here):
<div id="app">${appRenderer}</div>
// ...
// Set title and meta description
${() => {
helmet = Helmet.renderStatic()
return ''
}}
appendToHead('${() => helmet.title.toString()}')
appendToHead('${() => helmet.meta.toString()}')
Now helmet needs to be instantiated after rendering the app, but since rapscallion throws an error when returning undefined from an expression* I'm just returning an empty string. This isn't really a big deal and the current solution works fine.
But, I thought it might be nice to allow expressions that evaluate to undefined, which would then just insert nothing. No idea if that's possible or even desirable, but it would allow me to omit the return ''.
*: throw new Error("Unknown value in template of type " + (typeof segment === "undefined" ? "undefined" : _typeof(segment)) + ": " + segment);
The text was updated successfully, but these errors were encountered:
I'm using rapscallion and am using helmet to render a title and meta description (see here):
Now helmet needs to be instantiated after rendering the app, but since rapscallion throws an error when returning undefined from an expression* I'm just returning an empty string. This isn't really a big deal and the current solution works fine.
But, I thought it might be nice to allow expressions that evaluate to undefined, which would then just insert nothing. No idea if that's possible or even desirable, but it would allow me to omit the
return ''
.*:
throw new Error("Unknown value in template of type " + (typeof segment === "undefined" ? "undefined" : _typeof(segment)) + ": " + segment);
The text was updated successfully, but these errors were encountered: