With the recent trends in Front-End Web Development, we've seen a lot of additions in the JavaScript frameworks collection, with each of them being unique in its own way, coming with its own perks and disadvantages.
As such, I wanted to have a look at the React side of things only, check the main 2 frameworks built on top of the React library, and see why would anyone pick one against the others, and what does each brings to the table in terms of Front-End development.
Note: In this article, for the sake of simplicity, I'll only compare the main reason that each framework/library was created in order to fulfill/the main application type that those technologies are used for:
If you want to research more in-depth about other applications that can be built using those technologies, I will give you a hint:
Firstly, we'll have to get ourselves comfortable with 3 important concepts:
Afterward, we'll be able to proceed with the comparison and analyze the pros & cons of each approach in terms of choosing the Front-End technologies (Framework / Library in our case):
You might already be familiar with the concept, as it's thrown all over the place nowadays, but if you aren't, SEO is referring to the process/optimization of a website that has as a goal the higher ranking on Google Search Engine.
A well-optimized website in terms of SEO is likely to be listed on the first few pages of Google.
SSR refers to an application's ability to render content on the server (Back-end) and return the whole page rendered, as opposed to rendering the page in the browser.
It is similar to how PHP, Ruby, Java, and other server languages/frameworks have been serving content from the beginning.
All of the data will be processed on the Back-end and after it's all been done, only then will the content be sent back to the client.
SSG is a tool that allows for generating full HTML pages based on predefined templates and raw data which are prepared to be rendered ahead of time. As opposed to traditional CMSs, which are database-driven, SSGs generate content from static Markdown files/GraphQL without the need for a database.
Now that we've gotten a bit more comfortable with these concepts, let's check out the pros/cons of each technology mentioned in opposition with the others:
Pros:
Cons:
Pros:
Cons:
Pros:
Cons:
After going through the pros/cons of each, it's only natural to check out some use-cases for each framework/library, as such, you'll be able to get a better picture of which technology suits your business needs better.
React
As a result of React's CRA's pros & cons, it is best suited for scenarios where SEO isn't as important, or where development time has to be short.
Use-cases:
Whenever there is a requirement for good SEO, and rarely-changing content, Gatsby is well-suited.
Use-cases:
Next.js would be the main contestant whenever we're talking about good SEO and a lot of changes within the content of the application.
Use-cases:
Social Media Platforms
Big eCommerce apps
SaaS Applications
With all of that said, I hope you now have a better idea about choosing the right Frontend technology for your project in terms of what React has to offer.
Cheers, all!
This article was first published here