HonoH
Hono13mo ago
scruffy

Argument of type 'Element' is not assignable to parameter of type 'Container'

Using https://github.com/honojs/examples/tree/main/hono-vite-jsx, stripped back for a minimal repro...

The following code gives me a TypeScript error, "Argument of type 'Element' is not assignable to parameter of type 'Container'".

Any ideas as to how best to resolve the error?

import { useState } from 'hono/jsx'
import { render } from 'hono/jsx/dom'

function App() {
  return (<Counter />)
}

function Counter() {
  const [count, setCount] = useState(0)
  return (<button type="button" onClick={() => { setCount(count + 1) }}>Clicked {count} times</button>)
}

const root = document.querySelector('#root')!
// @ts-expect-error -- Element not assignable to Container
render(<App />, root)
Was this page helpful?