DEV Community

Medea
Medea

Posted on

Finally learning Next.js

Since I got into web development with Flask, I've always wanted to learn Next.js since it's a very popular web framework.
But I usually prefer Python so I've been procrastinating learning Next.js.
Today I decided to try it out.

First of all, I'd like to say that the tutorial on the Next.js website is amazing.
It's very engaging, has a lot of facts and teaches very well.

During the tutorial today, I built my first website with React.js:

<!-- index.html -->
<html>
  <body>
    <div id="app"></div>
    <script src="https://unpkg.com/react@17/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
    <!-- Babel Script -->
    <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
    <script type="text/jsx">
      const app = document.getElementById('app');
      ReactDOM.render(<h1>Develop. Preview. Ship. 🚀</h1>, app);
    </script>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

which had the output:
first react website


I will continue learning Next.js and will post whenever I write some new code with Next.js.


Thanks to @ironcladdev and @dillonb07 for persuading me to start learning Next.js.
I know it's been a while since I wanted to learn it, but it's better late than never!

Top comments (10)

Collapse
 
nielsabildgaard profile image
Niels Abildgaard

Cool! Do you have any plans for what to build?

What are you noticing most, coming from Flask?

Collapse
 
vulcanwm profile image
Medea

I’m thinking of migrating a project I’m building right now from Flask to Next.js. I’m going to finish making the app the next.js website has a tutorial on, then try making the same app on Flask and see the different in run times
Honestly, Flask was so much easier

Collapse
 
nielsabildgaard profile image
Niels Abildgaard

What is it that's making Next.js harder, do you think? Or what makes Flask easier?

Thread Thread
 
vulcanwm profile image
Medea

for flask you just have routes where you have get requests, then you can easily do your backend functions and then render your template for frontend.
next.js isn't as simple as that lmao

Thread Thread
 
nielsabildgaard profile image
Niels Abildgaard

Ha, yeah, that's true.

I think in that regard, express or fastify are more similar to Flask.

Next.js is built for a different kind of use case, with dynamic and more expressive frontends, as well as support for static-site generation in cases where that has a performance advantage. Those things can be done with Flask or express or fastify, but it's not the normal case, whereas with Next.js it is.

Thread Thread
 
vulcanwm profile image
Medea

Yea i've tried express, but frontend is much more easier with next.js
do you think building a website like discipulis.vulcanwm.repl.co/ would be good to build in next.js?

Thread Thread
 
nielsabildgaard profile image
Niels Abildgaard

I think you could definitely build it in Next.js!

If I were you, I would try to learn into the dynamic interactivity of Next.js with it. Like, focus on getting instant responses, instead of having to submit forms to see e.g. the result of converting a noun or verb. That would play to Next.js and React's strengths.

Thread Thread
 
vulcanwm profile image
Medea

I’ll try that out after I’m done learning the basics of next.js and have tried out making a simple project with it first.
Thanks for your advice!

Collapse
 
codeofrelevancy profile image
Code of Relevancy

It’s great to see you learning Next.js
Just smash💥 it..

Collapse
 
vulcanwm profile image
Medea

thanks!