Busi
0
Q:

spread types may only be created from

function foo<T extends object>(t: T): T {
  return { ...(t as object) } as T;
}
0
function foo<T extends object>(t: T): T {

  return {
    ...t    // Error: [ts] Spread types may only be created from object types.
  }
}
0

New to Communities?

Join the community