I've been trying to implement an extended interface with fields that are inserted after fetching data from the API.
My interfaces:
Blocks.d.ts
export interface InputsEntity {
features: Features;
commitment: string;
}
SingleBlock.d.ts
export interface Inputs extends InputsEntity {
group: string;
size: number;
color: string;
}
In my react side:
const inputsData: Inputs[] = inputs.map((i:InputsEntity) => {
i.size = inputs.length;
i.color = '#F97C0C';
return i as Inputs
});
An error is coming up:
Property 'size' does not exist on type 'InputsEntity'.
I'm guessing I'm not mapping this properly, any help or direction will be appreciated!