Next.js has taken the web dev world by storm

It’s the @reactjs framework devs rave about praising its power, flexibility, and dev experience

Don't feel like you're missing out!

Here's everything you need to know in 10 tweets

Let’s dive in 🧵

@reactjs Next.js is a @reactjs framework from @vercel

It couples a great dev experience with an opinionated feature set to make it easy to spin up new performant, dynamic web apps

It's used by many high-profile teams like @hulu, @apple, @Nike, & more

https://t.co/whCdm5ytuk
@reactjs @vercel @hulu @Apple @Nike The team at @vercel, formerly Zeit, originally and launched v1 of the framework on Oct 26, 2016 in the pursuit of universal JavaScript apps

Since then, the team & community has grown expotentially, including contributions from giants like @Google

https://t.co/xPPTOtHoKW
@reactjs @vercel @hulu @Apple @Nike @Google In the #jamstack world, Next.js pulled a hefty 58.6% share of framework adoption in 2020

Compared to other popular @reactjs frameworks like Gatsby, which pulled in 12%

*The Next.js stats likely include some SSR, arguably not Jamstack

https://t.co/acNawfcM4z
@reactjs @vercel @hulu @Apple @Nike @Google The easiest way to get started with a new Next.js app is with Create Next App

Simply run:

yarn create next-app

or

npx create-next-app

You can even start from a git-based template with the -e flag

yarn create next-app -e https://t.co/JMQ87gi1ue

https://t.co/rwKhp7zlys
@reactjs @vercel @hulu @Apple @Nike @Google Next.js uses a file-system based router

Meaning the files you create and their names, are what's used to create your website pages

/pages/index.js
=> / (homepage)

/pages/about.js
=> /about (About)

You can also add dynamic routes for more complex apps

https://t.co/9Wx8lHwMai
@reactjs @vercel @hulu @Apple @Nike @Google The foundation of Next.js comes from SSR

SSR = Server Side Rendering

On each browser request, Next.js renders the React page and serves the HTML to the browser

If any data is needed, getServerSideProps can be used to fetch dynamic data during render

https://t.co/oYeF5vOAtr
@reactjs @vercel @hulu @Apple @Nike @Google It's also capable of SSG

SSG = Static Site Generation

`next export` takes the Next.js website, renders the project similar to how it would on the server, and saves it as static files and assets

getStaticProps allows you to fetch data at build time

https://t.co/Ad7AHqx2QY
@reactjs @vercel @hulu @Apple @Nike @Google There's also a hybrid approach with ISR

ISR = Incremental Static Regeneration

Caching mechanisms serve pages statically while refreshing stale content in the background on the server

Setting revalidate on getStaticProps defines how often it refreshes

https://t.co/NOE4tmB1DK
@reactjs @vercel @hulu @Apple @Nike @Google Next.js can also create APIs with serverless functions

It also uses file-system based routing to create new routes

/pages/api/my-endpoint.js
=> /api/my-endpoint

Inside, you export a handler function to handle the request and response

https://t.co/I5iNM4ZmPe
@reactjs @vercel @hulu @Apple @Nike @Google Instead of a dedicated plugin ecoystem, Next.js maintains opinionated packages that get bundled into the framework

next/image provides a range of optimizations like compression, automatic modern formats, and responsive sizing

https://t.co/SdG48w9GQc
@reactjs @vercel @hulu @Apple @Nike @Google Next.js is a flexible framework that gives you as a developer a lot of power over creating great experiences on the web.

Want to dive more into Next.js & React?

Check out my @eggheadio course:

Create an eCommerce Store with Next.js and Stripe Checkout

https://t.co/jlqUZwEyfE
I’ll also be giving a deep dive on Next.js at @snipcart’s first webinar

Snipcart & Friends Present: WTF is Next.js?

March 1st at 2pm EST

Register for free below

https://t.co/vreUBG7rZC
You can find a bunch of tutorials for Next.js and other web dev tools on my YouTube channel

https://t.co/HLAvBFKICC
Make sure to also subscribe to my newsletter.

I send out free weekly tutorials teaching React, Next.js, and other web dev tools

https://t.co/dDN1vLiuoO

More from Tech

You May Also Like

I hate when I learn something new (to me) & stunning about the Jeff Epstein network (h/t MoodyKnowsNada.)

Where to begin?

So our new Secretary of State Anthony Blinken's stepfather, Samuel Pisar, was "longtime lawyer and confidant of...Robert Maxwell," Ghislaine Maxwell's Dad.


"Pisar was one of the last people to speak to Maxwell, by phone, probably an hour before the chairman of Mirror Group Newspapers fell off his luxury yacht the Lady Ghislaine on 5 November, 1991."
https://t.co/DAEgchNyTP


OK, so that's just a coincidence. Moving on, Anthony Blinken "attended the prestigious Dalton School in New York City"...wait, what? https://t.co/DnE6AvHmJg

Dalton School...Dalton School...rings a

Oh that's right.

The dad of the U.S. Attorney General under both George W. Bush & Donald Trump, William Barr, was headmaster of the Dalton School.

Donald Barr was also quite a


I'm not going to even mention that Blinken's stepdad Sam Pisar's name was in Epstein's "black book."

Lots of names in that book. I mean, for example, Cuomo, Trump, Clinton, Prince Andrew, Bill Cosby, Woody Allen - all in that book, and their reputations are spotless.
The UN just voted to condemn Israel 9 times, and the rest of the world 0.

View the resolutions and voting results here:

The resolution titled "The occupied Syrian Golan," which condemns Israel for "repressive measures" against Syrian citizens in the Golan Heights, was adopted by a vote of 151 - 2 - 14.

Israel and the U.S. voted 'No'
https://t.co/HoO7oz0dwr


The resolution titled "Israeli practices affecting the human rights of the Palestinian people..." was adopted by a vote of 153 - 6 - 9.

Australia, Canada, Israel, Marshall Islands, Micronesia, and the U.S. voted 'No' https://t.co/1Ntpi7Vqab


The resolution titled "Israeli settlements in the Occupied Palestinian Territory, including East Jerusalem, and the occupied Syrian Golan" was adopted by a vote of 153 – 5 – 10.

Canada, Israel, Marshall Islands, Micronesia, and the U.S. voted 'No'
https://t.co/REumYgyRuF


The resolution titled "Applicability of the Geneva Convention... to the
Occupied Palestinian Territory..." was adopted by a vote of 154 - 5 - 8.

Canada, Israel, Marshall Islands, Micronesia, and the U.S. voted 'No'
https://t.co/xDAeS9K1kW
I hate when I learn something new (to me) & stunning about the Jeff Epstein network (h/t MoodyKnowsNada.)

Where to begin?

So our new Secretary of State Anthony Blinken's stepfather, Samuel Pisar, was "longtime lawyer and confidant of...Robert Maxwell," Ghislaine Maxwell's Dad.


"Pisar was one of the last people to speak to Maxwell, by phone, probably an hour before the chairman of Mirror Group Newspapers fell off his luxury yacht the Lady Ghislaine on 5 November, 1991."
https://t.co/DAEgchNyTP


OK, so that's just a coincidence. Moving on, Anthony Blinken "attended the prestigious Dalton School in New York City"...wait, what? https://t.co/DnE6AvHmJg

Dalton School...Dalton School...rings a

Oh that's right.

The dad of the U.S. Attorney General under both George W. Bush & Donald Trump, William Barr, was headmaster of the Dalton School.

Donald Barr was also quite a


I'm not going to even mention that Blinken's stepdad Sam Pisar's name was in Epstein's "black book."

Lots of names in that book. I mean, for example, Cuomo, Trump, Clinton, Prince Andrew, Bill Cosby, Woody Allen - all in that book, and their reputations are spotless.