TS1385

error TS1385: Function type notation must be parenthesized when used in a union type.

Broken Code ❌

1
type MyCallback = () => number | () => string

Fixed Code ✔️

When using a union type, you have to put additional function types in parentheses:

1
type MyCallback = () => number | (() => string)