#Can the function keyword be used within a `type`?
5 messages · Page 1 of 1 (latest)
5 messages · Page 1 of 1 (latest)
This gives an error:
type ContentCallback = function ($dialogElementBody: string): void;
This doesn't:
type ContentCallback = ($dialogElementBody: string) => void;
Is that just the way it is; can type only use arrow syntax?
type ContentCallback = {
($dialogElementBody: string): void
}
If you aren't typing this, it's the same as an arrow function though.
Yeah, functions are either method syntax or arrow syntax, not function keyword syntax.
oh, right. Thank you