DEV Community

loading...

Discussion on: State of JavaScript 2020 Results are declared!

Collapse
buraksaraloglu profile image
Burak Saraloglu

How did Next.js end up in backend frameworks?

Collapse
myogeshchavan97 profile image
Yogesh Chavan Author

Next.js is primarily used for creating Server Side rendered applications using React. They are also used for static site generation as an alternative to Gatsby

Collapse
dennisfrijlink profile image
Dennis Frijlink

So Next.js is used for creating SSR applications but the framework by itself is based on React and that's a frontend library right? Libraries/frameworks like Node or Deno are in my mind backend?

Thread Thread
myogeshchavan97 profile image
Yogesh Chavan Author

Next.js allows us to write both front-end and back-end code. It runs on the server-side. So using just Next.js we can write front-end code using React and also back-end code. Usually backend code is written under pages/api folder in Next.js app

Thread Thread
dennisfrijlink profile image
Dennis Frijlink

Nice! Think all the time Next.js is a React library just like Gatsby but focused on Server side rendering (instead of Static site generation like Gatsby). Nice to know!

Thread Thread
myogeshchavan97 profile image
Yogesh Chavan Author

Next.js looks like a front-end only but that's not the case. It has access to node APIs and we can also use npm packages directly in Next.js apps so there is no need of maintaining separate codebases for front-end and back-end.

It's also easy to use static site generator as compared to Gatsby