smolter
Types

NavigationType

The three browser history operation names.

Compatibility

ReactAvailable in this renderer's browser integration.
React SSRAvailable to this renderer's SSR integration; browser event handlers run after hydration.
PreactAvailable in this renderer's browser integration.
Preact SSRAvailable to this renderer's SSR integration; browser event handlers run after hydration.

Import from @kasperrt/smolter/react @kasperrt/smolter/preact

Signature

type NavigationType = "POP" | "PUSH" | "REPLACE";

Contract

The union is "POP" | "PUSH" | "REPLACE". POP includes the initial entry and history traversal; PUSH adds an entry; REPLACE updates the current entry.

import type { NavigationType } from "@kasperrt/smolter/preact";

export function replacedEntry(type: NavigationType): boolean {
  return type === "REPLACE";
}

Usage and limits

Read this through useNavigationType after the application navigation integration is installed. It is not the same as loading/submitting/idle request state.

View implementation ↗