Fejlesztőknek
Kezdj bele
Témák/Theme SDK/Modules/routing

routing

Ez az oldal még csak angolul érhető el.

Links, the router, page params and the merchant's site pages.

Ezen az oldalon
import { … } from '@poltura/theme-sdk/routing';

Hooks

NameWhat it is
useRouterThe router, for moving the visitor from code.
usePathnameThe path of the current page.
useSearchParamsThe query string of the current page.
usePageParamsThe params the current theme page's route captured.
useSitePageThe merchant's site page the current page renders.
useNotFoundPageThe not-found page the visitor is on, for the section that draws it.

Parts

NameWhat it is
LinkA link inside or out of the store that navigates without a full page load where it can.

Functions

NameWhat it is
redirectStops rendering the page and sends the visitor to another one.
notFoundStops rendering the page and shows the store's not-found page.
pageHrefThe URL of a site page.

Types

NameWhat it is
LinkPropsProps of Link.
RouterNavigation actions for code that moves the visitor without a link.
PageParamsThe params a theme page's route captured, such as slug; a catch-all's rest is under $.
SitePageRefA link to one of the merchant's site pages.
SitePageOne of the merchant's site pages, with its place among the others.
NotFoundPageTextsThe store's wording on its not-found page, in the page language.
NotFoundPageWhat the store's not-found page shows: its wording and the categories it suggests instead.
Utoljára frissítve