Skip to content
API/<ReactRouterAdapter>

<ReactRouterAdapter>

component
src/components/react-router-adapter.tsx1 parameter

Make React Router the router adapter of every list below it.

Render it inside the router — in the root route’s component, around its <Outlet /> — so the lists read React Router’s location and navigate through it. Only the components that use a list re-render when the URL changes.

import { ReactRouterAdapter } from '@qubeejs/react/react-router';
function ReactRouterAdapter(props: ReactRouterAdapterProps): ReactElement
Parameter Type Description
props ReactRouterAdapterProps The subtree, and whether a list navigation lets React Router reset the scroll

The subtree, with the adapter in context

function Root(): ReactElement {
return (
<ReactRouterAdapter>
<Outlet />
</ReactRouterAdapter>
);
}

ReactRouterAdapterProps