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
Hi, I'm currently upgrading my project to Inertia.js v3.
I noticed a significant change in the SSR render callback. In previous versions, we could return an object containing both head and body:
// Old way (v2)
render: (el)=>({head: [styles],body: html})
However, in v3, it seems the render function now strictly expects a single HTML string.
My question is: What is the best practice for injecting Emotion's extracted styles (critical CSS) into the head in v3? >
Should I simply prepend the <style> tags to the HTML string like this: return ${styleTags}${html} ? Does Inertia v3 automatically parse and move these tags to the head?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm currently upgrading my project to Inertia.js v3.
I noticed a significant change in the SSR render callback. In previous versions, we could return an object containing both head and body:
However, in v3, it seems the render function now strictly expects a single HTML string.
My question is: What is the best practice for injecting Emotion's extracted styles (critical CSS) into the head in v3? >
Should I simply prepend the <style> tags to the HTML string like this: return
${styleTags}${html}? Does Inertia v3 automatically parse and move these tags to the head?Beta Was this translation helpful? Give feedback.
All reactions