FormidableLabs / FormidableLabs/react-ssr-prepass
React 18 shim
Open
- 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
Contributor guide
Assessment
This issue has not been assessed yet.