RedirectOptions

external interface RedirectOptions : NavigateOptions(source)

Properties

Link copied to clipboard
abstract var from: RoutePath?
Link copied to clipboard
abstract var hash: String?
Link copied to clipboard

If set to true, the router will scroll the element with an id matching the hash into view with default ScrollIntoViewOptions. If set to false, the router will not scroll the element with an id matching the hash into view. If set to ScrollIntoViewOptions, the router will scroll the element with an id matching the hash into view with the provided options.

Link copied to clipboard
abstract var headers: HeadersInit?

The HTTP headers to use when redirecting.

Link copied to clipboard
abstract override var href: String?

This can be used instead of to to navigate to a fully built href, e.g. pointing to an external target. API Docs

Link copied to clipboard
abstract var ignoreBlocker: Boolean?

If true, navigation will ignore any blockers that might prevent it.

Link copied to clipboard
abstract var params: Params?
Link copied to clipboard
abstract var reloadDocument: Boolean?

If true, navigation to a route inside of router will trigger a full page load instead of the traditional SPA navigation.

Link copied to clipboard
abstract var replace: Boolean?

replace is a boolean that determines whether the navigation should replace the current history entry or push a new one.

Link copied to clipboard
abstract var resetScroll: Boolean?

Defaults to true so that the scroll position will be reset to 0,0 after the location is committed to the browser history. If false, the scroll position will not be reset to 0,0 after the location is committed to history.

Link copied to clipboard
abstract var search: Search?
Link copied to clipboard
abstract var state: HistoryState?
Link copied to clipboard
abstract var statusCode: Short?

The HTTP status code to use when redirecting.

Link copied to clipboard
abstract var throw: Boolean?

If provided, will throw the redirect object instead of returning it. This can be useful in places where throwing in a function might cause it to have a return type of never. In that case, you can use redirect({ throw: true }) to throw the redirect object instead of returning it.

Link copied to clipboard
abstract var to: RoutePath?
Link copied to clipboard

If set to true, the router will wrap the resulting navigation in a document.startViewTransition() call. If ViewTransitionOptions, route navigations will be called using document.startViewTransition({update, types}) where types will be the strings array passed with ViewTransitionOptions["types"]. If the browser does not support viewTransition types, the navigation will fall back to normal document.startTransition(), same as if true was passed.