Closed sibelius closed 7 years ago
Whats wrong with string | null
for a nullable type?
I think it is the same, I little bit more verbose
It is not the same.
?:
allows omission of the property.
| null
allows value to be null, but does not allow omission of the property.
The difference is important, because in one case you need to do check such as movie.updatedAt && movie.updatedAt === 'something'
and in the | null
case just movie.updatedAt === 'something'
is enough.
what about
updatedAt: ?string
?
Looks like thats a shortcut for | null
.
I have not seen it in the docs, but it is documented here.
current output:
updatedAt: string | null
it should be
updatedAt?: string