Skip to content

Commit 5441664

Browse files
Merge pull request #338 from preactjs/readme-suspense
chore: Update readme for suspense rendering
2 parents a50c93d + ffa8ea2 commit 5441664

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff 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';
130129
import { Main } from './main';
131130

132131
const 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>

0 commit comments

Comments
 (0)