Skip to content

How to handle possibly undefined objects in initial create #2907

Closed Answered by dai-shi
coltanium13 asked this question in Q&A
Discussion options

You must be logged in to vote

is it fine to cast the empty object as the type

It's not fine if you want to get type checks. I would do this person: undefined as Person | undefined.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@coltanium13
Comment options

Answer selected by coltanium13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants