-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Closed
Description
- I tried using the
@types/reactpackage and had problems. - I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
- I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
- Mention the authors (see
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[]'.
edorivai, TheFullResolution, donaldpipowitch, mcabrams, ChuckJonas and 34 morewrench32, garrettmaring, mortoray, kenjiru and gistnuHUB
Metadata
Metadata
Assignees
Labels
No labels