Skip to content
API/useBrowserAdapter()

useBrowserAdapter()

hook
src/hooks/use-browser-adapter.ts0 parameters

A RouterAdapter for apps without a router: history.pushState / replaceState, plus the back and forward buttons.

Every instance on the page stays in sync, because navigations fan out to all of them. On the server the location is empty.

import { useBrowserAdapter } from '@qubeejs/react';
function useBrowserAdapter(): RouterAdapter

The current pathname and query, and a navigate that moves the browser

function Articles(): ReactElement {
const list = useQubeeList(articleList, useBrowserAdapter());
return <a href={list.href({ page: 2 })}>2</a>;
}

RouterAdapter