How to use the react-static.usePrefetch function in react-static

To help you get started, we’ve selected a few react-static examples, based on popular ways it is used in public projects.

github neo-one-suite / neo-one / packages / neo-one-website / src / components / RouterLink.tsx View on Github external
export const RouterLink = ({ to, ...props }: RouterLinkProps & React.ComponentProps<typeof Link>) => {
  const ref = usePrefetch(to);

  // tslint:disable-next-line no-any
  return <Link ref={ref as any} to={to} {...props} />;
};