Files
bun.sh/bench/react-hello-world/react-hello-world.jsx
evan a9e4ff2029 cleanup benchmarks folder (#587)
* cleanup benchmarks

* run prettier
2022-07-12 01:40:12 -07:00

26 lines
579 B
JavaScript

// import { renderToReadableStream } from "react-dom/server.browser";
var { renderToReadableStream } = import.meta.require(
"../../test/bun.js/reactdom-bun.js"
);
const headers = {
headers: {
"Content-Type": "text/html",
"Cache-Control": "no-transform", // set to match the Deno benchmark, which requires this for an apples to apples comparison
},
};
const App = () => (
<html>
<body>
<h1>Hello World</h1>
</body>
</html>
);
export default {
async fetch(req) {
return new Response(await renderToReadableStream(<App />), headers);
},
};