You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The thing is when you have an object function argument and specify a default value for it's property with complex type, Flow doesn't recognize type properly.
It may be hard to explain, just check this example: Example
For example, I can't create a function, which accepts object with property that can be either an array of functions or a single function.
For those who want a quick look:
type MyType = number[] | number;
function myfunc({
// Here flow screams that default arg is incompatible with number (WTF?)
arg = 3,
}: { arg: MyType }) {
console.log(arg);
}
The text was updated successfully, but these errors were encountered:
The thing is when you have an object function argument and specify a default value for it's property with complex type, Flow doesn't recognize type properly.
It may be hard to explain, just check this example: Example
For example, I can't create a function, which accepts object with property that can be either an array of functions or a single function.
For those who want a quick look:
The text was updated successfully, but these errors were encountered: