Flow, : https://flow.org/try/, : Type argument 'T' is incompatible. Property 'label' is incompatible Property not found.
, t Sealed Objects, arr - .
, t arr2, arr2 - ( Javascript). arr2. arr2 .
, :
const t: Array<{label: string}> = [{label:'1'}];
const t1: {label: string} = {label: `1`};
const w: Array<{label: string}> = [t1];
const t2: {label: string} = {label: `2`};
w.push(t2);
:
let w: Array<{label: string}> = [];
const t3: {} = {};
w.push(t3);
:
const u: Array<Object> = [{label:'1'}];
const arr: Array<{}> = u;
const v: Array<{}> = [{label:'1'}];
const arr2: Array<Object> = v;
const t3: {foo: number} = {foo:1};
arr2.push(t3);