useActionData
- It returns the data from the nearest action
- The data would be undefined when the action is not triggered yet
import { useActionData } from "@remix-run/react";
export default function MyComponent() {
const data = useActionData();
// Display the data
}
Action Data: