React 16 components can have multiple root elements.
const Items = ({ items }: MyProps) => items.map(item => <div key={item.id}>{item.name}</div>)
However, TypeScript will break with:
error TS2605: JSX element type 'Element[]' is not a constructor function for JSX elements. Property 'render' is missing in type 'Element[]'.
@types/reactpackage and had problems.Definitions by:inindex.d.ts) so they can respond.React 16 components can have multiple root elements.
const Items = ({ items }: MyProps) => items.map(item => <div key={item.id}>{item.name}</div>)However, TypeScript will break with:
error TS2605: JSX element type 'Element[]' is not a constructor function for JSX elements. Property 'render' is missing in type 'Element[]'.