FormidableLabs / FormidableLabs/react-ssr-prepass

React 18 shim

Open
#80 3 comments 16 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
603
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Now that `react-dom/server` support data fetching and suspense as of `react-dom@18`, I was wondering how much work it would be to replace `react-ssr-prepass` and it turned out to be pretty blissful. So I'm writing this issue to share a cheeky drop-in replacement, I came by this repo earlier looking for such a thing so I figured I would provide it now that I figured it out:

```js
import { renderToPipeableStream } from "react-dom/server";
await new Promise((onAllReady, onError) => renderToPipeableStream(, { onAllReady, onError }));
```

Here's the diff in my app
image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.