react: Comment out intersection type test (#28535)

This commit is contained in:
Andy
2018-09-05 11:21:31 -07:00
committed by GitHub
parent 2f0f634b17
commit 83b529136c
2 changed files with 12 additions and 10 deletions
+6 -5
View File
@@ -127,11 +127,12 @@ export abstract class SetStateTestForExtendsState<P, S extends { baseProp: strin
}
// Below tests that & generic still works
export abstract class SetStateTestForAndedState<P, S> extends React.Component<P, S & { baseProp: string }> {
foo() {
this.setState({ baseProp: 'foobar' });
}
}
// This is invalid because 'S' may specify a different type for `baseProp`.
// export abstract class SetStateTestForAndedState<P, S> extends React.Component<P, S & { baseProp: string }> {
// foo() {
// this.setState({ baseProp: 'foobar' });
// }
// }
interface NewProps { foo: string; }
interface NewState { bar: string; }
+6 -5
View File
@@ -100,8 +100,9 @@ export abstract class SetStateTestForExtendsState<P, S extends { baseProp: strin
}
// Below tests that & generic still works
export abstract class SetStateTestForAndedState<P, S> extends React.Component<P, S & { baseProp: string }> {
foo() {
this.setState({ baseProp: 'foobar' });
}
}
// This is invalid because 'S' may specify a different type for `baseProp`.
// export abstract class SetStateTestForAndedState<P, S> extends React.Component<P, S & { baseProp: string }> {
// foo() {
// this.setState({ baseProp: 'foobar' });
// }
// }