spread types may only be created from object types firebase code example
Example 1: spread types may only be created from
function foo<T extends object>(t: T): T {
return { ...(t as object) } as T;
}
Example 2: spread types may only be created from object types firebase
... doc.payload.doc.data() as {}
Example 3: spread types may only be created from
function foo<T extends object>(t: T): T {
return {
...t // Error: [ts] Spread types may only be created from object types.
}
}