Download react-query/examples/solid/astro/src/components/Link.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 404 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/solid/astro/src/components/Link.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/solid/astro/src/components/Link.tsx
-
curl -L -o Link.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/solid/astro/src/components/Link.tsx
404 Bytes
| 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> | |
| ) | |
| } | |