Skip to content

Why is data in onSuccess of useAction optional? #214

Closed Answered by TheEdoRan
maltesa asked this question in Q&A
Discussion options

You must be logged in to vote

See:

The reason is that the action runs onSuccess callback even when you use redirect, which internally throws an error caught by Next.js to perform the redirect. In this case, data is undefined.

Replies: 1 comment 1 reply

Comment options

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

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