"hooks/useOnStateChanged" | @uirouter/react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "hooks/useOnStateChanged"

Index

Functions

Functions

useOnStateChanged

  • A hook that invokes the provided callback whenever the current state changes.

    The callback receives the StateDeclaration and parameter values of the new current state.

    Example:

    function ShowCurrentState() {
      const [routerState, setRouterState] = useState('');
      useOnStateChanged((state) => setState(state.name);
      return <span>{routerState ? `state changed to ${routerState}` : null}</span>
    }

    Parameters

    Returns void

Generated using TypeDoc