I'm new to both React and TypeScript so there might be something obvious that I have missed. I'm trying to do the following:
const props = Object.assign({}, this.props, {
loaded: this.state.loaded
});
I get this error in my .tsx
file: Property 'assign' does not exist on type 'Object constructor'.
Found this thread and tried:
const props = (<any>Object).assign({}, this.props, {
loaded: this.state.loaded
});
Gave me this error: Property 'any' does not exist on type 'JXS.IntrinsicElements'.
I also tried this which returned Unexpected modifier
for declare.
declare interface ObjectConstructor {
assign(target: any, ...sources: any[]): any;
}
What have I missed?