Skip to content
Discussion options

You must be logged in to vote

We've discussed this and we don't want to allow async functions at the type level. We're probably going to start warning at runtime when you return a Promise from an event handler.

We didn't used to warn because we didn't have a good alternative. With React 19 we have: Use an Action or wrap the async function in startTransition.

We may start automatically wrapping async functions in startTransition. But with any additive API this comes with the risk of breaking existing usages that relied on existing behavior even though it was never supported. So by officially allowing them now (even though it "just works"), we increase the risk of not being able to make that change because too much of t…

Replies: 2 comments 23 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
23 replies
@eps1lon
Comment options

eps1lon Jul 17, 2024
Collaborator

@karlhorky
Comment options

@ProchaLu
Comment options

@eps1lon
Comment options

eps1lon Aug 21, 2024
Collaborator

Answer selected by jasikpark
@karlhorky
Comment options

@jasikpark
Comment options

@markerikson
Comment options

@vcarl
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pkg: react Discussions related to react