React Router
useActionData
Read the result of a navigation submission action for the route.
Formal Syntax & Structure
react syntaxreact
const result = useActionData();Working Example
Example Snippetreact
result?.errorRead the result of a navigation submission action for the route.
const result = useActionData();result?.error