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

Module "hooks/useRouter"

Index

Functions

Functions

useRouter

  • A hook that returns the UIRouter instance

    Example:

    const FormSubmit() {
      const router = useRouter();
      const form = useContext(FormFromContext);
      function submit() {
        validateForm(form)
          .then(submitForm)
          .then(() => router.stateService.go('home'));
      }
    
      return <button onClick={submit}>Submit form</button>;
    }

    Returns UIRouter

Generated using TypeDoc