File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -97,10 +97,10 @@ options.errorBoundaries = true;
9797
9898---
9999
100- ### ` Suspense ` & ` lazy ` components with [ ` preact/compat ` ] ( https://www.npmjs.com/package/preact ) & [ ` preact-ssr-prepass ` ] ( https://www.npmjs.com/package/preact-ssr-prepass )
100+ ### ` Suspense ` & ` lazy ` components with [ ` preact/compat ` ] ( https://www.npmjs.com/package/preact )
101101
102102``` bash
103- npm install preact preact-render-to-string preact-ssr-prepass
103+ npm install preact preact-render-to-string
104104```
105105
106106``` jsx
@@ -125,19 +125,12 @@ const Main = () => {
125125```
126126
127127``` jsx
128- import { render } from ' preact-render-to-string' ;
129- import prepass from ' preact-ssr-prepass' ;
128+ import { renderToStringAsync } from ' preact-render-to-string' ;
130129import { Main } from ' ./main' ;
131130
132131const main = async () => {
133- // Creation of the virtual DOM
134- const vdom = < Main / > ;
135-
136- // Pre-rendering of lazy components
137- await prepass (vdom);
138-
139- // Rendering of components
140- const html = render (vdom);
132+ // Rendering of lazy components
133+ const html = await renderToStringAsync (< Main / > );
141134
142135 console .log (html);
143136 // <h1>Home page</h1>
You can’t perform that action at this time.
0 commit comments