Skip to main content
Glama
deleonio
by deleonio
link-react-router.tsx853 B
import { KolLink } from '@public-ui/react-v19'; import type { FC } from 'react'; import React from 'react'; import { useNavigate } from 'react-router-dom'; import { SampleDescription } from '../SampleDescription'; export const LinkReactRouter: FC = () => { const navigate = useNavigate(); const on = { onClick: (event: Event) => { event.preventDefault(); navigate('/back-page'); }, }; return ( <> <SampleDescription> <p> This sample shows how KolLink works with react-router. Primary click uses preventDefault() and navigate(...), while right click open in new tab still follows _href. Make sure _href and navigate(...) point to the same path. </p> </SampleDescription> <div className="grid gap-4"> <KolLink _href="/back-page" _inline={false} _label="Go to overview" _on={on} /> </div> </> ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deleonio/public-ui-kolibri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server