60b0267400
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com> Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
12 lines
389 B
JavaScript
12 lines
389 B
JavaScript
import createEmotionServer from '@emotion/server/create-instance'
|
|
import { cache } from '@emotion/css'
|
|
|
|
export const renderStatic = async (html) => {
|
|
if (html === undefined) {
|
|
throw new Error('did you forget to return html from renderToString?')
|
|
}
|
|
const { extractCritical } = createEmotionServer(cache)
|
|
const { ids, css } = extractCritical(html)
|
|
|
|
return { html, ids, css }
|
|
}
|