npm install preact-render-to-stringimport render from "preact-render-to-string";import { App } from "./App"; const html = render(<App />);preact-render-to-stringOfficial HTML rendering package for server-side rendering and static generation.
Built for Preact and does not require a React compatibility layer.