TypeScript/tests/cases/compiler/jsxCallbackWithDestructuring.tsx
Wesley Wigham 99d6b0d308
Actually get the apparent type of intersection members when calculating intersection apparent types (#21133)
* Actually get the apparent type of intersection members when calculating intersection apparent types

* Add nonjsx variant

* Fix nit
2018-01-17 15:20:09 -08:00

31 lines
873 B
TypeScript

// @jsx: preserve
// @noImplicitAny: true
// @strictNullChecks: true
// minimal component
interface Component<P = {}, S = {}> { }
declare class Component<P, S> {
constructor(props: P, context?: any);
render(): {};
props: Readonly<{ children?: {} }> & Readonly<P>;
}
declare global {
namespace JSX {
interface Element { }
interface ElementClass {
render(): {};
}
interface ElementAttributesProperty { props: {}; }
interface ElementChildrenAttribute { children: {}; }
interface IntrinsicAttributes { }
interface IntrinsicClassAttributes<T> { }
}
}
export interface RouteProps {
children?: (props: { x: number }) => any;
}
export class MyComponent<T extends RouteProps = RouteProps> extends Component<T> { }
<MyComponent children={({ x }) => {}}/>