H
Hono6mo ago
tcurdt

[solved] HtmlEscapedString not rendering?

When I have this function
import { HtmlEscapedString } from 'hono/utils/html'

async function render (c): Promise<HtmlEscapedString> {
return c.html(<button>FOO</button>)
}
import { HtmlEscapedString } from 'hono/utils/html'

async function render (c): Promise<HtmlEscapedString> {
return c.html(<button>FOO</button>)
}
Why would this not render?
.get('/', async (c) => {
return c.html(
<BaseLayout>
button: {await render(c)}
</BaseLayout>
)
.get('/', async (c) => {
return c.html(
<BaseLayout>
button: {await render(c)}
</BaseLayout>
)
1 Reply
tcurdt
tcurdtOP6mo ago
This is because render() returns a reponse - not a HtmlEscapedString. A little weird there is not giving a type error.
Want results from more Discord servers?
Add your server