What You Need to Know Before Learning NextJS

PedroTech
27 Oct 202210:34

Summary

TLDRThe video clarifies that learning React is not a prerequisite for learning Next.js, as Next.js is built on React and enhances it with features like easier routing and server-side rendering. It emphasizes the importance of understanding the evolution of these technologies and staying updated with community trends. The video also discusses the benefits of Next.js for SEO and its potential to become more popular in the future, suggesting that React developers should familiarize themselves with it.

Takeaways

  • ๐Ÿ“š You don't need to learn React before learning Next.js, as they are not alternatives but rather Next.js is built on top of React with additional features.
  • ๐Ÿš€ Next.js is more of an alternative to tools like Create React App or Vite, offering a more streamlined way to create React applications.
  • ๐ŸŒŸ Next.js simplifies certain aspects of React development, such as adding routing, making it potentially easier for beginners to start with Next.js.
  • ๐Ÿ” Knowledge from building React applications can be beneficial when transitioning to Next.js, as it provides a foundation for understanding the framework.
  • ๐ŸŽ Sponsored by themeselection.com, which offers admin templates for React and Next.js, including a Material UI React Next.js admin template.
  • ๐Ÿ› ๏ธ Building a production-ready Next.js app can be challenging, but using templates can save time and ensure best practices are followed.
  • ๐Ÿ’ก Customizing templates is easy, and a bundle is available with pre-made templates and components for various projects.
  • ๐Ÿ“ˆ SEO is improved with Next.js due to its ability to do server-side rendering, unlike client-side rendering in React which can result in empty initial HTML.
  • ๐Ÿค” It's important for developers to understand their proficiency level with React before transitioning to Next.js to avoid just learning the basics of both and not excelling in either.
  • ๐ŸŒ Keeping up with new technologies and understanding their advantages is crucial for web developers aiming to excel in their field.

Q & A

  • Is it necessary to learn React before starting with Next.js?

    -No, it is not necessary to learn React before learning Next.js. Next.js uses React as its basis and adds more features to it. It is more of an alternative to tools like Create React App or Vite for building React applications.

  • What is the main difference between React and Next.js?

    -React is a JavaScript library for building user interfaces, while Next.js is a framework that simplifies building React applications. Next.js provides features like easy routing and server-side rendering, which are not present in basic React setups.

  • Why might a beginner find it easier to learn Next.js compared to React?

    -Next.js has beginner-friendly features such as easy routing and server-side rendering that simplify the development process. These features are not as straightforward in basic React setups, making Next.js potentially easier for beginners to grasp.

  • How does Next.js benefit SEO compared to a typical Create React App website?

    -Next.js supports server-side rendering, which means that the initial HTML sent to the browser includes the UI elements. This allows search engines to index the page content effectively, leading to better SEO rankings. In contrast, Create React App relies on client-side rendering, which can result in empty initial HTML and poor SEO.

  • What is server-side rendering and how does it help with SEO?

    -Server-side rendering is a technique where the server generates the full page HTML before sending it to the client. This ensures that the content is available in the initial HTML load, which is beneficial for SEO as search engines can crawl and index the content easily, leading to better rankings.

  • What is the role of 'get server-side props' in Next.js?

    -In Next.js, 'get server-side props' is a method that allows you to run React components on the server to generate HTML before the JavaScript executes. This enables the sending of fully loaded HTML to the client, improving SEO and user experience by having content available before JavaScript is loaded and synced.

  • Why is it important for developers to keep up with new technologies and trends?

    -Keeping up with new technologies and trends is crucial for developers to stay competitive and provide the best solutions. Understanding the advantages and disadvantages of new tools helps developers make informed decisions about which technologies to adopt for their projects.

  • What advice is given to developers who feel they know enough about React but are considering transitioning to Next.js?

    -Developers should assess their current skill level and understanding of React before transitioning to Next.js. It's important to not underestimate the depth of knowledge required and to ensure that one is not merely shifting from one framework to another without a solid foundation.

  • How does the speaker suggest developers should approach learning new technologies?

    -The speaker suggests that developers should obsess over the community and the learning path, continuously updating their knowledge and understanding of new technologies. This proactive approach helps developers stay ahead and make informed decisions about which technologies to adopt.

  • What is the significance of Google Trends data for developers?

    -Google Trends data can indicate the popularity and growth of a technology, which can guide developers in their learning and adoption decisions. For instance, the speaker notes that Next.js is gaining popularity over React, suggesting that it might become more dominant in the future.

  • How can developers ensure they are not just learning the basics of a technology but truly mastering it?

    -Developers should hold themselves accountable, assess their understanding of core concepts and best practices, and continuously challenge themselves with more complex projects. They should also engage with the community and stay informed about advancements and trends in their field.

Outlines

00:00

๐ŸŒ Is Learning React Necessary Before Next.js?

This section clarifies a common misconception about Next.js and React, emphasizing that they are not alternatives but rather complementary. Next.js, built on React, offers an enhanced development experience with features like easy routing. The presenter argues that it might be easier to start with Next.js due to its beginner-friendly aspects. However, existing knowledge from React, especially through Create React App, can make learning Next.js smoother. A special mention of a sponsor, ThemeSelection, is made, showcasing their React and Next.js admin templates which could significantly reduce development time for new projects.

05:01

๐Ÿš€ Next.js: Bridging the SEO Gap in React Apps

This segment discusses the limitations of client-side rendering in React, specifically its negative impact on SEO due to search engines' inability to index content that isn't initially present in the HTML document. Next.js is presented as a solution through its server-side rendering capabilities, which can pre-render pages for faster loading and better SEO. The presenter urges understanding the importance of server-side rendering and its implications for web development. There's also a cautionary advice for developers to deeply understand React before jumping to Next.js, highlighting the risk of accumulating superficial knowledge across multiple frameworks.

10:01

๐Ÿ‘จโ€๐Ÿ’ป Closing Thoughts and Call to Action

The final section wraps up the video with gratitude towards the sponsor, ThemeSelection, and encourages viewers to explore their products. The presenter reflects on the importance of staying updated with evolving technologies and the potential of Next.js (or similar frameworks) to dominate future web development trends. The segment concludes with an appeal for viewer engagement through likes, comments, and shares, emphasizing the value of community feedback and participation in guiding future content.

Mindmap

Keywords

๐Ÿ’กReact

React is a popular JavaScript library for building user interfaces, especially for web applications. The video mentions React in the context of comparing it with Next.js, emphasizing that React is the basis upon which Next.js builds. While React focuses on creating components and managing the state of an application, Next.js extends these capabilities with additional features like server-side rendering and file-based routing, making it not an alternative to React, but a complementary tool that leverages React.

๐Ÿ’กNext.js

Next.js is a React framework that provides features such as server-side rendering and static site generation, aiming to improve the performance and developer experience of web applications. The video discusses Next.js as more than just an alternative to create-react-app or Vite, highlighting its role in simplifying the process of building React applications with advanced features like easy routing, improved SEO, and faster page loads.

๐Ÿ’กCreate React App

Create React App is a toolchain provided by the React team to set up a new React application with no build configuration. The video contrasts Create React App with Next.js, pointing out that while Create React App is a starting point for React projects, Next.js offers a more feature-rich environment for developing React applications, particularly with its support for server-side rendering.

๐Ÿ’กServer-Side Rendering (SSR)

Server-side rendering is a technique used in web development where the HTML of a page is generated on the server and sent to the client, instead of being generated in the browser. The video highlights SSR as a key feature of Next.js, which allows applications to load faster and improve SEO by rendering content on the server before it reaches the client, solving a common problem faced by React applications built with client-side rendering.

๐Ÿ’กSEO

SEO stands for Search Engine Optimization, a crucial aspect of web development that involves improving a site to increase its visibility when people search for products or services related to the business in search engines. The video emphasizes that Next.js improves the SEO of React applications by utilizing server-side rendering, which ensures that the content of the page is available to search engines when they crawl the site.

๐Ÿ’กRouting

Routing refers to the process of selecting a path for traffic in a network or between or across multiple networks. In the context of web development, it involves managing the way users navigate through a web application. The video mentions that Next.js makes routing easier and more intuitive than React alone, particularly because of its file-based routing system that automatically routes files in the pages directory.

๐Ÿ’กStatic Site Generation (SSG)

Static Site Generation is a method of building websites where pages are generated at build time. The video briefly touches on this concept when discussing the flexibility of Next.js, which supports both server-side rendering and static site generation, allowing developers to choose the best approach for each page based on its requirements.

๐Ÿ’กHooks

Hooks are a feature introduced in React 16.8 that allow functional components to use state and other React features without writing a class. The video discusses using hooks and functional components as best practices in React development, which are also applicable in Next.js projects. Hooks such as useState, useEffect, useMemo, and useCallback are essential for managing state and side effects in React applications.

๐Ÿ’กgetServerSideProps

getServerSideProps is a Next.js feature that allows developers to fetch data on the server side and pass it as props to the page. This function is part of Next.js's server-side rendering capabilities, enabling applications to render pages with dynamic data from the server, thereby improving performance and SEO. The video explains this feature to highlight how Next.js enhances React applications by enabling server-side data fetching.

๐Ÿ’กClient-Side Rendering

Client-side rendering is the process where the web browser downloads the minimal HTML from the server, and the JavaScript fetched thereafter renders the application UI. The video contrasts this with server-side rendering, pointing out the limitations of client-side rendering in terms of SEO and initial load performance. This context underlines the advantages of Next.js, which can overcome these limitations with its server-side rendering capabilities.

Highlights

You don't need to learn React to start learning Next.js, as they are not alternatives but rather Next.js uses React as its basis.

Next.js is more of an alternative to create-react-app or Vite, offering a different approach to building React applications with additional features.

Learning Next.js can be easier for beginners due to its friendly features, such as easy addition of routing compared to React.

Knowledge from building React applications with create-react-app can be beneficial in learning Next.js more easily.

This video is sponsored by themesolection.com, which offers admin templates for projects and businesses, including a Material UI React Next.js admin template.

The templates provided by themesolection.com are made with the latest versions of technologies and include best practices for React, such as using Hooks and functional components.

Using a template like those from themesolection.com can save time in building a production-ready and functional Next.js app.

The video discusses how a page loads in React using client-side rendering and the issues with this approach, such as poor SEO ranking due to empty initial HTML.

Next.js offers server-side rendering, which allows for fully loaded HTML to be sent before JavaScript is loaded and synced, improving SEO.

Server-side rendering with Next.js solves a major issue with React by providing SEO benefits and ensuring that the initial HTML includes all necessary content.

The video emphasizes the importance of understanding why you're learning Next.js to maintain discipline and motivation in the learning process.

For developers who know React but aren't proficient, transitioning to Next.js without a solid understanding of React can lead to only knowing the basics and not excelling in either.

The video encourages developers to stay updated with new technologies and understand their advantages and disadvantages over current tools.

Next.js or a variation of it is expected to become more popular in the future, as seen in trends comparing React.js and Next.js.

The video concludes with a recommendation for React developers to familiarize themselves with Next.js to stay ahead in the field.

A call to action is made for viewers to check out themesolection.com and take advantage of a special offer for the first 100 people using a code from the video description.

The video ends with a thank you note to the viewers and the sponsor, emphasizing the importance of community and continuous learning in web development.

Transcripts

play00:00

so if you clicked on this video I assume

play00:02

you want to learn next.js but you want

play00:05

to know if you need to learn react

play00:07

before that or how much of react you

play00:09

need to learn before starting to learn

play00:11

next so the first thing I want to say is

play00:13

that you actually don't need to learn

play00:15

react to start learning xjs especially

play00:17

because people mistakenly think that

play00:19

react to next.js are alternatives from

play00:22

each other when they are really not I

play00:24

would say next is more of an alternative

play00:25

to something like create react tap or

play00:28

something like Vite because it is more

play00:30

of a way to create your react

play00:33

application rather than something that

play00:36

is different from an app that is made

play00:39

with react actually next uses react as

play00:42

its basis and it changes some of the

play00:44

things and adds more features to it so

play00:46

for that reason it is not necessary to

play00:48

learn react before next in fact I

play00:50

actually believe it's easier to learn

play00:52

nextges compared to learning react

play00:54

because it has some very beginner

play00:56

friendly features such as the fact that

play00:58

you can really easily add route to it

play01:00

compared to react but all of this

play01:02

doesn't mean that you can use some

play01:04

knowledge you gained from

play01:06

um building react applications using

play01:07

something like create react app to

play01:10

actually learn next in an easier way and

play01:12

at the end of the video I'll even let

play01:13

you all on an advice for the future but

play01:16

for now here is everything you might

play01:18

want to know before learning next chance

play01:22

[Music]

play01:22

[Applause]

play01:24

[Music]

play01:28

[Applause]

play01:31

this video is sponsored by

play01:33

themesolection.com if you're looking to

play01:35

get any admin template for your projects

play01:37

or your business you should check them

play01:39

out for example they have an amazing

play01:41

material UI react next.js admin template

play01:45

for anyone who is looking to build a

play01:46

really nice Project without having to

play01:48

spend a lot of time building the main

play01:50

core features the templates are all made

play01:52

with the newest versions of their own

play01:54

Technologies for example this one I just

play01:56

said is made with the latest version of

play01:57

react and material UI and it also

play02:01

includes a lot of the best practices

play02:03

that are already set for react such as

play02:05

building your templates using Hooks and

play02:07

functional components building a

play02:09

production ready and functional next.js

play02:11

app is really hard so using a template

play02:14

like the ones they provide can really

play02:16

save a lot of your time it is also

play02:18

really easy to customize your own

play02:19

template so if you're interested they're

play02:21

currently releasing a bundle which will

play02:24

give you eight pre-made templates with a

play02:26

lot of pre-made components that you can

play02:28

use inside of any of your projects and

play02:30

if you decide to use the code that is on

play02:32

the description you will get 15 off if

play02:34

you're one of the first 100 people who

play02:36

would click the link in the description

play02:38

trust me when I say they have a really

play02:40

really nice product and if you're

play02:41

actually building something that will be

play02:43

used by a lot of people you really don't

play02:44

want to play around with it you might

play02:46

want to get something like this to help

play02:48

you save a lot of time again thank you

play02:50

theme selection for sponsoring and let's

play02:52

get into the video so the first thing

play02:54

that you really need to understand

play02:55

before starting to learn next is exactly

play02:58

how does a page load in react so when

play03:01

you load a page

play03:03

um using client-side rendering in react

play03:06

normally what would happen is the

play03:08

following imagine an example where you

play03:10

have a page where you wanna fetch data

play03:13

for for example the list of friends from

play03:15

a user and then just display that data

play03:18

in that page so if you're using

play03:19

something like create react app to

play03:21

create your react application and you're

play03:23

loading and rendering everything from

play03:25

the client what would happen is the

play03:27

following first

play03:28

um you would make a request the page

play03:30

would make a request to receive the HTML

play03:32

and it would receive an HTML completely

play03:34

empty basically it will be just an empty

play03:36

HTML with a single div with an idea of

play03:39

root and nothing inside of it and then

play03:42

it will also have some scripts I'm

play03:44

fetching all the JavaScript that we have

play03:47

for our application you can even check

play03:49

this by actually going to any website

play03:51

that was created using Create react Tab

play03:53

and just trying to download the source

play03:55

code you'll look at it and you'll be

play03:57

confused because none of the UI elements

play03:59

will actually be in the HTML because

play04:01

they don't exist initially the HTML is

play04:04

completely empty so the source code

play04:06

obviously won't have any of that what

play04:08

react does is it then loads the

play04:11

JavaScript from the JavaScript script

play04:13

tag and further fetches the list of

play04:16

users so only after the HTML is received

play04:20

by the browser they actually downloads

play04:22

all the JavaScript and fetches the data

play04:24

and puts it inside of the inside of the

play04:27

actual Dom so that's the thing you only

play04:28

get the correct UI elements after the

play04:31

data fully fetched and the initial HTML

play04:34

doesn't include that stuff and that's

play04:35

that's a big problem to be honest so for

play04:37

example when a search engine like Google

play04:39

tries to rank their websites based on

play04:42

keywords what they do is they download

play04:44

the source code and uses that as uh

play04:46

basically what keywords that website

play04:49

contains but the thing is a normal

play04:51

create react app website won't have

play04:53

anything inside of their HTML inside of

play04:55

their source code initially so they will

play04:57

rank poorly on SEO standards and Google

play05:01

will basically not show the page because

play05:03

it doesn't know what the page is about

play05:05

because there's no keywords there's

play05:06

nothing it's just a mess there's a lot

play05:09

more to it but the thing the main issue

play05:11

in this case is that you're rendering

play05:13

everything in the client and

play05:15

um there is a solution to it which is

play05:17

what next allows us to do because next

play05:20

actually has a lot of flexibility it not

play05:23

only allows you to render Pages

play05:25

statically through the client but it

play05:27

also allows you to render your pages

play05:29

from the server which is also known as

play05:31

server side rendering so if you have a

play05:33

page that is not static such as the one

play05:35

then from the example and it's not a

play05:37

static because it constantly changes the

play05:39

the values of it depending on the data

play05:41

it fetches right you can use a method

play05:43

from next.js called get server-side

play05:45

props which allows us to run react on

play05:48

the server and send back the fully

play05:51

loaded HTML before the JavaScript is

play05:54

loaded and synced which means that we

play05:57

will have everything loaded into our

play05:59

source code before

play06:01

um actually trying to sync everything

play06:03

with JavaScript which is good because it

play06:05

will rank higher it will have good SEO

play06:06

and everything is already there a good

play06:08

example should be shown in the screen

play06:09

right now of how this would work and how

play06:11

what's the difference is but it allows

play06:14

for this which is amazing this is

play06:16

actually one of the main reasons people

play06:18

choose to use an xjs because one of the

play06:20

main issues with react is now solved and

play06:23

there's basically no downside to it so

play06:25

honestly I don't see the point of using

play06:28

normal like create create react tab

play06:30

instead of next.js when it's hard to

play06:33

find the negatives

play06:34

um in this case and it is important to

play06:36

understand this before learning next

play06:38

because there will be no purpose when

play06:41

learning next if you don't understand

play06:42

why you're learning it so understanding

play06:44

why you're learning it is fundamental

play06:45

and crucial for you to actually have the

play06:48

discipline and motivation to learn this

play06:49

framework that being said if you are a

play06:52

developer who um already knows a little

play06:54

bit of react but isn't really like good

play06:57

at it you just know how to make simple

play06:58

websites with it and you already want to

play07:00

transition to next I would say to stop

play07:03

and really think what you're doing

play07:04

because it is really easy for any kind

play07:06

of web developer to really confuse how

play07:09

much they actually know right not

play07:12

actually know enough and think they know

play07:14

more than they actually do I actually

play07:16

did this because uh on while I was

play07:18

learning react six months in I thought I

play07:21

was already pretty good with react but

play07:22

at that point I didn't know some of the

play07:24

most important features of react like

play07:26

when and where to use some of the hooks

play07:29

like use memo and use callback I didn't

play07:31

know that and I considered myself

play07:32

intermediate to Advanced in react which

play07:35

is crazy to me now because there's

play07:37

always a lot more to learn so you have

play07:40

to understand where you are and you

play07:41

can't be transitioning from one

play07:43

framework to the other and just learning

play07:45

the basics because then you just know

play07:46

the basics for everything and not be

play07:48

good at anything so I'm saying this

play07:49

because I know there are a lot of

play07:51

developers out there that do this and I

play07:53

did this too so being able to tell

play07:55

yourself and understand and kind of hold

play07:58

yourself accountable in that case is

play07:59

really important as well so what's the

play08:01

point of this video you might ask

play08:02

because I just told you that you really

play08:04

don't need to know react before learning

play08:06

xjs and again when I say react I mean

play08:10

um the create react tab ecosystem

play08:12

instead of react as a whole because

play08:14

nexjs uses react right but the point is

play08:18

the following technology will evolve as

play08:20

we go right I started learning react

play08:22

three years after it got released I

play08:24

believe and

play08:26

um now I already see Trends showing that

play08:29

uh react normal react direct that I've

play08:31

always known might not be the future now

play08:34

does that mean that we should stop

play08:36

learning react and keep switching to the

play08:38

new thing that is arriving all the time

play08:39

no that doesn't mean that especially

play08:41

because imagine if you're a big company

play08:42

with a huge code base you're not gonna

play08:44

like the resources for you to switch

play08:46

from one framework to the other just

play08:48

because of minor improvements is crazy

play08:51

so like react normal react will still be

play08:54

used a lot

play08:56

um in reality right but one of the

play08:58

things I preached the most about for

play09:00

people who are trying to really get

play09:02

really good at web dev is to obsess over

play09:05

the community and obsess over

play09:08

um The Learning path because if you just

play09:10

want to be a programmer who learns

play09:12

whatever you're learning does your job

play09:14

get paid and that's fine that's fine a

play09:16

lot of us do this too but if you really

play09:19

want to get be the best at what you're

play09:20

doing you really have to obsess over it

play09:22

and understanding and keeping up to date

play09:24

with the new technologies and exactly

play09:26

why they are better or worse than what

play09:28

we have right now is really important

play09:29

and I feel like if you are a react

play09:32

developer and you don't know next yet

play09:34

that's definitely something you should

play09:35

get your hands on because maybe that's

play09:37

not the future in the next one year or

play09:39

two years but trust me something either

play09:42

next or a variation of next will

play09:44

definitely be way more popular in the

play09:46

future because we're already seeing it

play09:48

if you look at the Google trends for

play09:50

react.js and xjs nexjs is already

play09:52

destroying react which is crazy right so

play09:55

that's my rent for today and I really

play09:57

appreciate if you guys liked this video

play09:59

If you enjoyed the video please leave a

play10:01

like and comment down below let me know

play10:02

what you want to see next again thank

play10:04

you so much for theme selection for

play10:06

sponsoring this video

play10:08

um you guys definitely keep the channel

play10:09

rolling I really appreciate if you guys

play10:11

could check them out they are really

play10:13

nice and yeah that's that's basically it

play10:15

I really appreciate you guys watching

play10:16

this video and I see you guys next time

play10:19

[Music]

play10:20

[Applause]

play10:22

[Music]

play10:31

thank you

play10:32

[Music]

Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
WebDevelopmentReactJSNextJSServerSideRenderingSEOLearningPathWebFrameworksJavaScriptFrontendTechTrends