I checked the latest typings and they forgot to add new definitions in a stateless component interface. I've raised the issue and it should be fixed soon.
Returning an array from class components works so if you really need it right now you can transform your functional component to class component.
class Elements extends React.Component<{}> {
render() {
return [
<div key="a"></div>,
<div key="b"></div>
]
}
}
or temporarily extend React typings using module augmentation. Just put the following code somewhere in one of your .ts files and typescript will automatically detect changes in definitions.
declare module "react" {
interface StatelessComponent<P = {}> {
(props: P & { children?: ReactNode }, context?: any): ReactElement<any>[] | ReactElement<any> | null;
propTypes?: ValidationMap<P>;
contextTypes?: ValidationMap<any>;
defaultProps?: Partial<P>;
displayName?: string;
}
}