mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
815 B
Plaintext
26 lines
815 B
Plaintext
computedPropertyBindingElementDeclarationNoCrash1.ts(12,21): error TS2739: Type '{ [x: string]: unknown; }' is missing the following properties from type 'State': a, b
|
|
|
|
|
|
==== computedPropertyBindingElementDeclarationNoCrash1.ts (1 errors) ====
|
|
// https://github.com/microsoft/TypeScript/issues/61351
|
|
|
|
export type State = {
|
|
a: number;
|
|
b: string;
|
|
};
|
|
|
|
export class Test {
|
|
setState(state: State) {}
|
|
test = (e: any) => {
|
|
for (const [key, value] of Object.entries(e)) {
|
|
this.setState({
|
|
~
|
|
[key]: value,
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
});
|
|
~~~~~~~
|
|
!!! error TS2739: Type '{ [x: string]: unknown; }' is missing the following properties from type 'State': a, b
|
|
}
|
|
};
|
|
}
|
|
|