I’ve used React Router on most of the projects I’ve worked on over the last few years, and as I’ve dealt with different routing requirements, I’ve always been pleased to see that React Router could handle whatever I threw at it.

But this flexibility doesn’t come for free.

It’s kinda like buying a VCR that can do multi-timeslot recording, automated channel switching, and sports a menagerie of inputs and outputs. A deluxe piece of technology to be sure, but it also has 73 buttons on the remote.

Sometimes you just need a play button.

So, I decided to strip React Router out of one of my sites and implement something that was tailor made.

What you will find below is certainly nothing revolutionary, and if you’re an expert, there’s probably nothing in this post for you. But the adventure was a success and I found the process interesting.

Maybe it will be interesting to you too.

Sweetening the pot

Although I didn’t start this with the aim of improving performance, there was a rather staggering 20% drop in load time.

The package size dropped by 13% from 104 KB gzipped to 90 KB, so I would have expected a drop in download/parse time of about the same. I’m honestly not sure where the other 7% improvement came from, but I’ll take it.