DEV Community

Dominic Rockson
Dominic Rockson

Posted on

I built a React Link component that prefetches before you click

Your app's navigation is only as fast as your Link component. The default one just... navigates. I wanted more, so I built rockzy-link.

What it does

  • Smart prefetching — analyzes and preloads routes users are likely to visit next, instead of prefetching everything and wasting bandwidth
  • Route caching — back/forward navigation feels instant
  • Scroll restoration — users land where they expect
  • Offline hooks — hooks so your UI degrades gracefully when the network drops
  • Navigation snapshots — capture and restore navigation state
  • Accessibility — proper semantics out of the box

Usage

npm i rockzy-link
Enter fullscreen mode Exit fullscreen mode
import { Link } from 'rockzy-link';

// Drop-in replacement — prefetching just works
<Link href="/dashboard" prefetch>Dashboard</Link>
Enter fullscreen mode Exit fullscreen mode

Why I built it

I'm a developer from Liberia working mostly in Zig and JavaScript. I kept hitting the same wall: client-side navigation that felt sluggish no matter how optimized the pages were. The bottleneck was the Link itself. So I fixed it at the source.

It's MIT licensed and I'd genuinely love feedback — try it, break it, tell me what's missing.

npm: https://www.npmjs.com/package/rockzy-link
GitHub: https://github.com/psrockstar098/rockzy-link

Top comments (0)