mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
react: Comment out intersection type test (#28535)
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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' });
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user