snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
20
examples/solid/astro/src/components/Link.tsx
Normal file
20
examples/solid/astro/src/components/Link.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
export const Link = (props: {
|
||||
href: string
|
||||
children: any
|
||||
class?: string
|
||||
}) => {
|
||||
// Links doing client-side navigation
|
||||
return (
|
||||
<a
|
||||
href={props.href}
|
||||
onClick={(e) => {
|
||||
e.preventDefault()
|
||||
history.pushState({}, '', props.href)
|
||||
window.dispatchEvent(new PopStateEvent('popstate'))
|
||||
}}
|
||||
class={props.class}
|
||||
>
|
||||
{props.children}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user