HonoH
Hono11mo ago
Mosh Ontong

Hono React with bun

Error:

Type '(props: Props) => boolean' is not assignable to type 'FC'.
  Type 'boolean' is not assignable to type 'HtmlEscapedString | Promise<HtmlEscapedString> | null'.ts(2322)
const Layout: FC


Code:

import { Hono } from "hono";
import { serveStatic } from "hono/bun";
import type { FC } from "hono/jsx";

const app = new Hono();

app.use(
  "/static/*",
  serveStatic({
    root: "./",
  })
);

app.get("/", (c) => c.text("Hello Bun!"));

const Layout: FC = (props) => {
  return (
    <html>
      <body>{props.children}</body>
    </html>
  );
};

export default app;
Was this page helpful?