-
You can simply run the (package.json) "scripts": {
"dev": "bun run --watch ./src/index.tsx", // index.tsx
import type { PropsWithChildren } from "hono/jsx";
import { Hono } from "hono";
const app = new Hono();
type FileManager = {
title: string;
paths?: string[];
};
function FileManager({ title, children }: PropsWithChildren<FileManager>) {
return (
<div>
<h1>{title}</h1>
{children}
</div>
);
}
app.get("/static", (c) => {
return c.html(<FileManager title="File Manager" />);
}); Good luck! |
Beta Was this translation helpful? Give feedback.
Answered by
fzn0x
Jun 6, 2024
Replies: 1 comment
-
You can simply run the (package.json) "scripts": {
"dev": "bun run --watch ./src/index.tsx", // index.tsx
import type { PropsWithChildren } from "hono/jsx";
import { Hono } from "hono";
const app = new Hono();
type FileManager = {
title: string;
paths?: string[];
};
function FileManager({ title, children }: PropsWithChildren<FileManager>) {
return (
<div>
<h1>{title}</h1>
{children}
</div>
);
}
app.get("/static", (c) => {
return c.html(<FileManager title="File Manager" />);
}); Good luck! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
fzn0x
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can simply run the
.tsx
file to run the server with JSX. It also helps developers in VSCode to enable the React syntax. (don't forget to change your VSCode language mode to TypeScript React)(package.json)
Goo…