HonoH
Hono2y ago
tcurdt

[solved] return type of request handler

Why is 1) is fine and 2) has a type problem?

1)

  .get('/foo', async (c) => {
    return await c.html(<body/>)
  })


2)

  .get('/bar', async (c) => {
    return await render(c)
  })

  async function render(c) : Promise<HtlEscapedString> {
    return await c.html(<body/>)
  }


I don't see it
Was this page helpful?