@gwn-sheet-stack/adapters-router-tanstack
v0.0.5
Published
TanStack Router adapter for sheet-stack.
Maintainers
Readme
@gwn-sheet-stack/adapters-router-tanstack
TanStack Router adapter for sheet-stack.
Install
bun add @gwn-sheet-stack/core @gwn-sheet-stack/adapters-router-tanstackPlus your framework binding (@gwn-sheet-stack/react) and TanStack Router itself.
Peer deps: @tanstack/react-router >=1, @gwn-sheet-stack/core.
Use
import { tanstackRouterAdapter } from '@gwn-sheet-stack/adapters-router-tanstack';
import { StackProvider, Stage } from '@gwn-sheet-stack/react';
import { router } from './router';
export function StackRoot({ children, registry }) {
const routerAdapter = tanstackRouterAdapter({ router });
return (
<StackProvider registry={registry} routerAdapter={routerAdapter}>
{children}
<Stage />
</StackProvider>
);
}The adapter reads/writes the URL through your existing TanStack Router instance, so back/forward buttons traverse the Layer history.
API
tanstackRouterAdapter(options)— produces aRouterAdapterfrom a TanStack Router instance. AcceptsTanstackAdapterOptions.
License
MIT
