score:0

Accepted answer

If you wish to pass a JSX element as a prop, you can use the type JSX.Element, but you will also have to change Base, since <Element/> assumes Element is a component, not an element. It works if you just return the element itself:

type BaseType = {
  element: JSX.Element
}

const Base = ({ element }: BaseType ) => element

const renderBase = (element: JSX.Element) =>
  <Base element={element} />

const Hello = () =>
  renderBase(<h1>Hello</h1>)

(I've also renamed Element to element, to emphasize it's not a component.)

TypeScript playground


Related Query

More Query from same tag