Skip to content

useActionData() always return undefined #10686

Closed Answered by kiliman
hungtcs asked this question in Q&A
Discussion options

You must be logged in to vote

When you useFetcher the returned data is on the fetcher instance.

const fetcher = useFetcher()
fetcher.submit()
fetcher.data // <- data is here

useActionData() only returns the data when you use <Form method="post"> or useSubmit()

Replies: 3 comments 17 replies

Comment options

You must be logged in to vote
7 replies
@kiliman
Comment options

Answer selected by hungtcs
@kiliman
Comment options

@alexweberk
Comment options

@kiliman
Comment options

@matjaeck
Comment options

Comment options

You must be logged in to vote
3 replies
@kiliman
Comment options

@kwabe007
Comment options

@sleepless000
Comment options

Comment options

You must be logged in to vote
7 replies
@kiliman
Comment options

@kiliman
Comment options

@elmeerr
Comment options

@alexanderhorner
Comment options

@Sergi17138
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
10 participants