Hono React with bun
Error:
Code:
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: FCType '(props: Props) => boolean' is not assignable to type 'FC'.
Type 'boolean' is not assignable to type 'HtmlEscapedString | Promise<HtmlEscapedString> | null'.ts(2322)
const Layout: FCCode:
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;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;