Next.js —Where have you been all my life?

How Next.js kept me writing React — in production.

Eshwaren M
Sep 10, 2019 · 3 min read

I almost gave up. My React SPA was great to code, but also completely useless. I had spent months to learn React, and a few more to convince the team to upgrade our Jquery powered front-end to React, all in the name of performance, better code re-usability, and future proofing.

We are an online news portal, so the site I was developing using React was more or less a blog. How hard can this be? A few routes, fetch some APIs, and voila! Not so fast. I shared the URL of my new shiny prototype to Facebook — nothing came up, no featured image, no proper title.

I realized Facebook will only scrap server side rendered meta tags. The only magic I can use at this point were pre-renderers. This complicates our build deployment processes, caching strategies and cost calculation. Also, Lighthouse didn’t show good scores. My heart broke.

Fortunately, I had more time. We didn’t upgrade our live site. No talk about this for a while. I continued to seek solutions. My new objectives were :

  1. Dynamic pages — with server side rendered meta tags
  2. React for interactivity after the page loads
  3. Lighthouse score above 80%
  4. Easy build and deployment process
  5. Easy local development

Not long after I Googled “Server side rendered React” , I found Next.js.

Here’s a good tutorial by Brad Traversy

📃 Dynamic pages

💫 React for interactivity

⚡️ Performance

🔧 Build and deploy

💻 Local development

In conclusion, I love Next.js and I encourage you to try it out!

JavaScript in Plain English

Learn the web's most important programming language.

Eshwaren M

Written by

Full Stack Engineer

JavaScript in Plain English

Learn the web's most important programming language.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade