Skip to content
Discussion options

You must be logged in to vote

when you read code like:

enq.effect(async () => {
  await fetch()
})

you might think that we actually do something with this promise, handle errors, or await its result. But that's not true. For the same reason, you can't directly use async functions together with React.useEffect: TS playground

It somewhat feels to me that you want this patch to trick the lint rule it's OK. But that lint rule exists exactly to guard you from misusing async functions in situations like this.

Replies: 2 comments 7 replies

Comment options

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

Comment options

You must be logged in to vote
6 replies
@williamrjribeiro
Comment options

@Andarist
Comment options

Andarist Oct 2, 2025
Collaborator

Answer selected by williamrjribeiro
@williamrjribeiro
Comment options

@davidkpiano
Comment options

@williamrjribeiro
Comment options

@ScottAwesome
Comment options

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