useAction

A hook to retrieve the result of a route's action. Use this in the route component of a route with an action prop.

import { useAction } from 'react-sprout';

let action = useAction();
  • Name
    action
    Type
    any
    Description

    The result of the action, or undefined if the route has no action, or if this navigation did not run one.

Suspense

While the action is busy, useAction will suspend your component. Use a react suspense boundary somewhere up in the component tree to display a fallback user interface.