First off: Why not just use HTML & Vanilla JS?
Yes, I know that there is an inherent speed benefit to using HTML. There are a couple reasons why I chose to go with a JS framework. The main reason is Reusable Components. This is a feature of all JS frameworks that are worth learning. I know that I will have multiple pages that will need to have a similar layout and this is the way to go. The other reason is that I find it significantly easier to integrate features when using a framework. Take React for example: the useState
hook is super useful.
In response to the first reason, some would say: Why not Hugo? I definitely looked at Hugo and it definitely has its uses but there wasn't an easy way to integrate React into it. And in response to that, some would say: Have you seen astro.build from Snowpack? I have, and that framework is certainly very cool but there are two issues with that: 1; the React loader wasn't working on my computer and 2; It didn't feel as flexible as some other options.
The Three Stooges of Web Development
React, Angular, and Vue
I decided to use React. The primary reason for this being that the first time I tried it, I fell in love with JSX. The syntactic sugar is insane. I love being able to reference variables and write JS expressions inside the markup. In addition to that, there's a massive developer community around React which makes it very versatile. However, React is known for being unopinionated about how you use it. How would I use it? This leads me to my next section:
The Dream Team
Next.js bills itself as the "React Framework for Production" and I could not agree more. Next is so easy to work with in addition to having great expansion capabilities. To shut down the alternatives: As for CRA, I didn't want to leave the automatic optimization that Next does; and for Gatsby, the docs are great but I find the framework itself to be a little bit daunting. It's also reassuring that Next has great support in the form of Vercel, who I doubt will be going anywhere since their valuation of over $1b.
Work Smarter, not Harder
JavaScript vs. TypeScript
When I started down my web development journey, I always used JS. I wanted to be a pure JS child above all before I learned tools like Typescript. I heard whispers of the magic of Typescript and then one day, I watched this video made by the great Jeff Delaney over at Fireship. I was sold primarily on the autocomplete and then doubly sold on the concept of type checking to catch my own stupidity.