Errors on useSignOut #19
Answered
by
tmm
cdedreuille
asked this question in
Q&A
|
I'm a bit confused by the syntax of the auth hooks. On signOut for example:
Should something like make more sense: |
Answered by
tmm
Jun 9, 2021
Replies: 1 comment 1 reply
I'm surprised that eslint isn't able to identify the correct Rename const [{ error: signOutError, fetching }, signOut] = useSignOut()
async function onClickSignOut() {
const { error: someOtherError } = await signOut()
}
if (signOutError) return <div>Error signing out</div>Don't destructure const [signOutResult, signOut] = useSignOut()
async function onClickSignOut() {
const result = await signOut()
}
if (signOutResult.error) return <div>Error signing out</div>
|
1 reply
Answer selected by
tmm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm surprised that eslint isn't able to identify the correct
error. Couple options available.Rename
errorwhen destructuring:Don't destructure
error: