Skip to content

| unknown included in all the types... am I missing something or does that defeat much of the purpose of generating types? #1786

Answered by mrlubos
scottstephens asked this question in Q&A
Discussion options

You must be logged in to vote

@scottstephens why not this?

async function handleClick(
  event: React.MouseEvent<HTMLButtonElement, MouseEvent>
) {
  const { data } = await getHello()
  if (data) {
    handleGetHelloResponse2({ data })
  }
}

or if you don't want to do checks...

async function handleClick(
  event: React.MouseEvent<HTMLButtonElement, MouseEvent>
) {
  const { data } = await getHello({ throwOnError: true })
  handleGetHelloResponse2({ data })
}

Replies: 1 comment 1 reply

Comment options

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

Answer selected by scottstephens
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