useRouterPush( options?:UseRouterPushOptions, ):{ routerPush:( to: |string |RouteLocationAsRelativeGeneric |RouteLocationAsPathGeneric, )=>Promise<void>; }
Wraps router.push() with error handling, since a rejected navigation
(e.g. a guard redirect, an invalid route) otherwise surfaces as an
unhandled promise rejection.
Generalizes three copies found in the audit: ama-deep's and
data-sheet-portal's (byte-identical - log + fall back to a hardcoded
404 route) and luv-autoq-frontend's (same, plus Sentry.captureException).
See UseRouterPushOptions.onError to opt into logging/fallback-navigation/
error-reporting yourself. Used internally by useRoutePermission for its
own permission-redirects.
Wraps
router.push()with error handling, since a rejected navigation (e.g. a guard redirect, an invalid route) otherwise surfaces as an unhandled promise rejection.Generalizes three copies found in the audit:
ama-deep's anddata-sheet-portal's (byte-identical - log + fall back to a hardcoded 404 route) andluv-autoq-frontend's (same, plusSentry.captureException). SeeUseRouterPushOptions.onErrorto opt into logging/fallback-navigation/ error-reporting yourself. Used internally byuseRoutePermissionfor its own permission-redirects.