TypeScript/tests/cases/compiler/reactReadonlyHOCAssignabilityReal.tsx
Wesley Wigham 3a2f7c0df1
Allow intersections of readonlys to be assignable to a readonly intersection (#28218)
* Allow intersections of readonlys to be assignable to a readonly intersection

* Add real motivating react example to test suite
2018-10-31 14:09:12 -07:00

12 lines
386 B
TypeScript

// @strict: true
// @jsx: react
/// <reference path="/.lib/react16.d.ts" />
import * as React from "react";
function myHigherOrderComponent<P>(Inner: React.ComponentClass<P & {name: string}>): React.ComponentClass<P> {
return class OuterComponent extends React.Component<P> {
render() {
return <Inner {...this.props} name="Matt"/>;
}
};
}