aboutsummaryrefslogtreecommitdiff
path: root/bench/react-hello-world.jsx
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-07-04 16:41:16 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-07-04 16:41:16 -0700
commitb685cd49a6360f55ad2752c5225fad8fe2ac0f05 (patch)
tree23fff777f288717a5cbe365d66b5954f8730671c /bench/react-hello-world.jsx
parent9c960fcafd52d6206c958d3e7791f72c6a059632 (diff)
downloadbun-b685cd49a6360f55ad2752c5225fad8fe2ac0f05.tar.gz
bun-b685cd49a6360f55ad2752c5225fad8fe2ac0f05.tar.zst
bun-b685cd49a6360f55ad2752c5225fad8fe2ac0f05.zip
[bench] Add a react ssr hello world
Diffstat (limited to 'bench/react-hello-world.jsx')
-rw-r--r--bench/react-hello-world.jsx19
1 files changed, 19 insertions, 0 deletions
diff --git a/bench/react-hello-world.jsx b/bench/react-hello-world.jsx
new file mode 100644
index 000000000..6715dd22f
--- /dev/null
+++ b/bench/react-hello-world.jsx
@@ -0,0 +1,19 @@
+// 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",
+ },
+};
+
+export default {
+ async fetch(req) {
+ return new Response(
+ await renderToReadableStream(<div>Hello World</div>),
+ headers
+ );
+ },
+};