Link Component

React <Link>

React has a <Link> component to link to pages within our React app.

Is is used instead of the <a> tag so React knows it is an internal link.

Because it's an internal link, React knows to only load the component that you need and not perform a complete page refresh. Use the <a> tag for that to link outside of your app.

GatsbyJS <Link>

GatstyJS takes this one step further by doing 2 things:

  • Any link created by <Link> that is visible in the viewport is prefetched using IntersectionObserver.
  • If a link is onMouseOver then the resource is loaded, so by the time you click on it the browser already has the page for you.
  • This helps MASSIVELY with performance. THANKS GatsbyJS
Go back to the homepage