aboutsummaryrefslogtreecommitdiff
path: root/bench/react-hello-world.deno.jsx
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-07-04 18:06:30 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-07-04 18:06:30 -0700
commitab7f57239d65901daf2a45951d267702578d3c67 (patch)
tree76788726131de464352a8ee1ff21638c646a8ba4 /bench/react-hello-world.deno.jsx
parenta8221356032cb8e24614b252a2deda1ab494f00e (diff)
downloadbun-ab7f57239d65901daf2a45951d267702578d3c67.tar.gz
bun-ab7f57239d65901daf2a45951d267702578d3c67.tar.zst
bun-ab7f57239d65901daf2a45951d267702578d3c67.zip
[bench] react hello world
Diffstat (limited to 'bench/react-hello-world.deno.jsx')
-rw-r--r--bench/react-hello-world.deno.jsx14
1 files changed, 10 insertions, 4 deletions
diff --git a/bench/react-hello-world.deno.jsx b/bench/react-hello-world.deno.jsx
index 25c960a80..62497972e 100644
--- a/bench/react-hello-world.deno.jsx
+++ b/bench/react-hello-world.deno.jsx
@@ -1,6 +1,15 @@
import { renderToReadableStream } from "https://esm.run/react-dom/server";
import { serve } from "https://deno.land/std@0.146.0/http/server.ts";
import * as React from "https://esm.run/react";
+
+const App = () => (
+ <html>
+ <body>
+ <h1>Hello World</h1>
+ </body>
+ </html>
+);
+
const headers = {
headers: {
"Content-Type": "text/html",
@@ -9,10 +18,7 @@ const headers = {
await serve(
async (req) => {
- return new Response(
- await renderToReadableStream(<div>Hello World</div>),
- headers
- );
+ return new Response(await renderToReadableStream(<App />), headers);
},
{ port: 8080 }
);