File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,14 @@ const key = 'custom'
47
47
const cache = createCache ({ key })
48
48
const { extractCriticalToChunks , constructStyleTagsFromChunks } = createEmotionServer (cache)
49
49
50
- let element = (
50
+ const html = renderToString (
51
51
< CacheProvider value= {cache}>
52
52
< App / >
53
53
< / CacheProvider>
54
54
)
55
55
56
- let { html, styles } = extractCriticalToChunks (renderToString (element))
56
+ const chunks = extractCriticalToChunks (html)
57
+ const styles = constructStyleTagsFromChunks (chunks)
57
58
58
59
res
59
60
.status (200 )
65
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
67
<meta http-equiv="X-UA-Compatible" content="ie=edge">
67
68
<title>My site</title>
68
- ${ constructStyleTagsFromChunks ({ html, styles }) }
69
+ ${ styles}
69
70
</head>
70
71
<body>
71
72
<div id="root">${ html} </div>
You can’t perform that action at this time.
0 commit comments