useIsRouting

useIsRouting returns an accessor for whether a route transition is in progress.


Import

import { useIsRouting } from "@solidjs/router";

Type

function useIsRouting(): () => boolean;

Parameters

useIsRouting takes no arguments.


Return value

  • Type: () => boolean

Returns an accessor that reads the current route transition state.


Behavior

  • The accessor becomes true when a transition target starts and false after the active transition finishes.

Examples

Basic usage

import { Show } from "solid-js";
import { useIsRouting } from "@solidjs/router";
function PendingRoute() {
const isRouting = useIsRouting();
return <Show when={isRouting()}>Loading route...</Show>;
}

Last updated: 5/6/26, 4:10 AMEdit this pageReport an issue with this page