Open
Description
Flow version: 214
Expected behavior
The partial type also accepts object literal as a default value since it is an extreme case where all properties were omitted
<T>(Partial<T> = {}) => {}
Actual behavior
Flow throws an incompatible type error because the object literal is incompatible with {...T}.
It can be circumvented by casting an any
type to the object.
<T>(Partial<T> = ({}: any)) => {}
Flow try demo
Activity