Home > other >  Should I use ReactJS or NextJS for a webapp for my use case (detail in desc.)?
Should I use ReactJS or NextJS for a webapp for my use case (detail in desc.)?

Time:08-17

Features in my web app:

  1. User Authentication
  2. Dynamic routes (Like /page/:id) => Fetching data from the backend according to the ID
  3. Using third-party APIs
  4. Not a static website - Uses backend for fetching data

If not NextJS, which framework should I use for a faster website as create-react-app is a bit slow?

CodePudding user response:

I'd recommend Vite the new features in react router are quite good (nested and layout routes) and combined with react query is just wonderful. Since your app already uses a backend no need for Nextjs.

CodePudding user response:

You should use React. NextJs is mostly used for websites where SEO plays a key role (think blogs, newssites, etc). Web applications are generally built with React, Vue, Angular, etc. Of course there are also other frameworks like Python Django and 1000 more. But if you are familiar with Javascript, then React/Vue for a webapplications would make the most sense.

CodePudding user response:

Nextjs is extremely fast as compare to reactjs because of its server side rendering functionality.

Moreover, you can use any of them for the above mentioned features but if you want your app to be faster and seo friendly as well then go for nextjs. Because, next js follows server side rendering which makes it a lot faster than react. To learn about server side rendering and client side rendering you can visit: Server Side vs Client Side Rendering.

Let's talk about the features you want to implement,

  1. You can easily implement user authentication functionality by using axios or fetch in both of them, by calling post API and then store the returned user data or token somewhere.
  2. For the dynamic routes in nextjs you can just make a folder inside pages folder which the name "Any Name You Want" and inside this folder you can create a file like "[id].js", this will act dynamically. Moreover, in reactjs you can do it which making the route just pass the path of route as /path/:id. For more you can read documentations for both of them these are well explained.
  3. For third party APIs you can use axios or fetch (axios is recommended).
  4. Also, as it is not a static website so you can make API calls using axios and then can display data using statements and rendering life cycles.

CodePudding user response:

if you want SEO in your web app you should use NEXT.JS

Next JS is a JavaScript framework that allows developers to create user-friendly and blazing fast static websites and static web applications with React. Next JS is an open-source, lightweight web development framework for React applications. It allows developers to build server-side rendering.

Next.js is based on React babel and webpack, which provides an out-of-the-box solution for server-side rendering (SSR) of React components. Next.js is an open-source JavaScript framework that allows developers to create dynamic and static web applications and websites.

if your application will grow in future and if you don't need of SEO then you should use REACT.JS

React has become one of the most used and well-known front-end libraries to build large web apps. Developed by Facebook, React is an open-source and flexible JavaScript library, allowing developers to develop scalable, simple, and fast frontend interfaces for Single Page Applications or Multi-page Web Applications. It supports a functional programming paradigm and a reactive approach.

  • Related