Closed
Description
TypeScript Version: 2.3.1
Code
import * as React from 'react';
function test<T extends object>(Component: React.StatelessComponent<T>, props: T) {
return <Component {...props} />
~~~~~~~~~~ error TS2698: Spread types may only be created from object types.
}
(same with React.ComponentClass
)
Expected behavior:
Compile without an error.
Actual behavior:
Error: error TS2698: Spread types may only be created from object types.
That was already reported in closed issue #14112