SlideShare a Scribd company logo
NEXT.J
S
• Next.js is a flexible React framework that
gives you building blocks to create fast web
applications.
1
INTRODUCTION
2
Server-Side Rendering
(SSR) is a technique that
allows your web application
to pre-render HTML on a
server, providing faster load
times and a better user
experience. In this tutorial,
we'll cover Next.js, a
framework for building
server-rendered React
applications.
WhyUse
SSR?
SSR can improve SEO,
performance, and user
experience. It allows search
engines to better crawl your site,
reduces the time to first paint, and
provides users with a fully rendered
page on the initial load. Next.js
simplifies the process of building
SSR applications.
3
GETTING STARTED WITH NEXT.JS
4
To get started with Next.js,
you'll need to install it and
create a new project. Next.js
provides several built-in
features, such as dynamic
imports, automatic code
splitting, and server-side
rendering. You can also easily
add custom routes and API
endpoints.
To build pages with Next.js,
you'll create a pages directory
and add React components for
each page. Next.js uses
getInitialProps to fetch data
and render the page on the
server. You can also use
dynamic routing and static site
generation to optimize
performance.
5
BUILDING PAGESWITH NEXT.JS
Deployin
g Your
Next.js
App
Next.js makes it easy to deploy
your app to Vercel, a cloud
platform for static and
serverless sites. Vercel
provides automatic SSL,
custom domains, and global
CDN. You can also deploy to
other platforms such as
Heroku or AWS.
6
Deploying Your Next.js
App
CONCLUSION
Next.js provides a powerful framework for building
server-rendered React applications. By using SSR,
you can improve SEO, performance, and user
experience. With Next.js, you can easily create
dynamic routes, API endpoints, and deploy your
app to the cloud. Keep learning and building!
7
Building Blocks of a Web Application
• User Interface - how users will consume and interact with your application.
• Routing - how users navigate between different parts of your application.
• Data Fetching - where your data lives and how to get it.
• Rendering - when and where you render static or dynamic content.
• Integrations - what third-party services you use (CMS, auth, payments, etc) and how
you connect to them.
• Infrastructure - where you deploy, store, and run your application code (Serverless,
CDN, Edge, etc).
• Performance - how to optimize your application for end-users.
• Scalability - how your application adapts as your team, data, and traffic grow.
• Developer Experience - your team’s experience building and maintaining your
9
React ?
Interactive User Interface
• JavaScript
library
for building
interactive user interfaces.
• User
interfaces,
-
users see and
interact
wit
h
Elements
that
on-
screen.
• Library - React provides helpful
functions to build UI, but leaves it
up to the developer where to use
those functions in their
application.
10
Next.js?
• React frameworkthat gives you building blocks to create
web
applications.
• Framework - Next.js handles the tooling and configuration
needed for React, and provides additional structure, features,
and optimizations for your application.
1
From JavaScript to React
12
Rendering User Interfaces
DOM vs UI
UI update with
JavaScript
• Create new file
index.html
// Select the div element with 'app'
id
// Create a new H1
element
// Create a new text node for the H1
element
// Append the text to the H1
element
// Place the H1 element inside the
div
<html>
<body>
<div id="app"></div>
<script type="text/javascript">
const app = document.getElementById('app');
const header = document.createElement('h1');
const headerContent = document.createTextNode(
'Develop. Preview. Ship.',
);
header.appendChild(headerContent);
app.appendChild(header);
</script>
</body>
</html>
15
Imperative vs Declarative Programming
• Imperative programming is like giving a chef step-by-step instructions
on how to make a pizza.
• Declarative programming is like ordering a pizza without being
concerned about the steps it takes to make the pizza.
• React is a Declarative Library
Imperative vs Declarative Programming
• Imperative programming is like giving a chef step-by-step instructions
on how to make a pizza.
• Declarative programming is like ordering a pizza without being
concerned about the steps it takes to make the pizza.
• React is a Declarative Library
Getting
Started with
React
• To use React in your project,
you can load two React scripts
from an external website
called unpkg.com:
• react is the core React library.
• react-dom
provides
DOM-
specific methods that
enable
you to use React with the
DOM.
<!-- index.html -->
<html>
<body>
<div id="app"></div>
<script src="https://unpkg.com/react@17/umd/r
eact.dev elopment.js"></script>
<script src="https://unpkg.com/react-
dom@17/umd/react-
dom.development.js"></script>
<script type="text/javascript">
const app =
document.getElementById('app');
</script>
</body>
</html>
18
Rendering React
• Instead of directly
manipulating the DOM with
plain JavaScript, you can use
ReactDOM.render(
)
th
e
metho
d
from react-domto tell React
to <h1
>
render our title inside
our
#ap
p
element
.
<!-- index.html -->
<html>
<body>
<div id="app"></div>
<script src="https://unpkg.com/react@17/umd/r
eact.dev elopment.js"></script>
<script src="https://unpkg.com/react-
dom@17/umd/react-
dom.development.js"></script>
<script type="text/javascript">
const app =
document.getElementById('app');
ReactDOM.render(<h1>Develop.
Preview. Ship.
</h1>, app);
</script>
</body>
</html>
18
JSX- JavaScript
Syntax Extension
• JSX is a syntax extension for JavaScript
that allows you to describe your UI in a
HTML-
like
familiar
syntax.
• The nice thing about JSX is that apart
from following three JSX rules, you
don’t need to learn any new symbols or
syntax outside of HTML and JavaScript.
• Note that browsers don’t understand JSX
out of the box, so you’ll need a JavaScript
compiler, such as a Babel, to transform
your JSX code into regular JavaScript.
<html>
<body>
<div id="app"></div>
<script src="
https://unpkg.com/react@17/umd/react.developm
ent.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.j
s"></script>
<script type="text/jsx">
const app = document.getElementById('app');
ReactDOM.render(<h1>Develop. Preview. Ship. </h1>,
app);
</script>
</body>
</html>
19
Component Trees
From React to
Next.js
31
Starting with
Next.js
Node.j
s
22
package.json {
}
npm install react react-dom
next
• Install
• create a new file called with an empty
object
• In your terminal, run
•
Remov
e react and react-dom scripts since you’ve installed them with NPM.
<html> and <body> tags because Next.js will create these for
you. ReactDom.render()
Babel script
• The
• The
• The code that interacts with app element and method.
• The because Next.js has a compiler that transforms JSX into
valid
JavaScript browsers can
understand.
<script type="text/jsx">
• The tag.
• The React. part of the React.useState(0)
function
// index.html
import { useState } from 'react’;
function Header({ title }) {
return <h1>{title ? title : 'Default
title'}</h1>;
}
function HomePage() {
const names = ['Ada Lovelace', 'Grace
Hopper', 'Margaret Hamilton’];
const [likes, setLikes] = useState(0);
function handleClick()
{ setLikes(likes + 1);
}
return ( <div> <Header title="Develop.
Preview. Ship. " />
<ul>
{names.map((name) => (
<li key={name}>{name}</li>
))}
</ul>
<button onClick={handleClick}>Like
({likes})</button> </div>
);
}
Changing Environment
page
s
1. Move the index.js file to a new folder called (more on
this
later).
default
export
2. Add to your main React component to help
Next.js
distinguish which component to render as the main
component of this page.
export default function HomePage() {
package.jso
n
Add a script to your file to run the Next.js
development
server while you develop.
// package.json { "scripts": { "dev": "next dev" },
// "dependencies": { // "next": "^11.1.0", // "react": "^17.0.2", // "react-
dom": "^17.0.2" // } }
Running the development server
import { useState } from 'react’;
function Header({ title }) {
return <h1>{title ? title : 'Default title'}</h1>;
}
export default function HomePage() {
const names = ['Ada Lovelace', 'Grace Hopper', 'Margaret Hamilton’];
const [likes, setLikes] = useState(0);
function handleClick() {
setLikes(likes + 1);
}
return ( <div> <Header
title="Develop.
Preview. Ship. " />
<ul>
{names.map((name) =>
(
<li
key={name}>{name}</li
>
))}
npm run dev
Create a Next.js App

More Related Content

PDF
PDF
next-230524050805-d1e22a49.pdferewrewrewrewr
PPTX
Reactjs notes.pptx for web development- tutorial and theory
PPTX
Full Stack_Reac web Development and Application
PPTX
GDSC NITS Presents Kickstart into ReactJS
PPTX
Progressive Web Apps and React
PPTX
INTRODUCTION TO REACT JAVASCRIPT FOR BEGINNERS.pptx
PPTX
How create react app help in creating a new react applications
next-230524050805-d1e22a49.pdferewrewrewrewr
Reactjs notes.pptx for web development- tutorial and theory
Full Stack_Reac web Development and Application
GDSC NITS Presents Kickstart into ReactJS
Progressive Web Apps and React
INTRODUCTION TO REACT JAVASCRIPT FOR BEGINNERS.pptx
How create react app help in creating a new react applications

Similar to NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg (20)

PDF
Reactjs Basics
PPTX
ASP .Net Core SPA Templates
PPTX
GDG Workshop on React (By Aakanksha Rai)
PPTX
mern _stack _power _point_ presentation(1)
PDF
What is Server-side Rendering? How to Render Your React App on the Server-sid...
PPTX
React JS .NET
PPTX
Advanced Web Technology.pptx
PPTX
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
PDF
An Overview of the React Ecosystem
PDF
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
PDF
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
PPTX
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
PDF
Installing Webpack with React JS from Scratch.pdf
PPTX
Introduction to angular | Concepts and Environment setup
PPTX
Web summit.pptx
PPTX
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
PDF
Making Of PHP Based Web Application
PDF
Revolutionizing Web Development with React Server Components: A Comprehensive...
PDF
Mastering react with redux
PDF
Full Stack React Workshop [CSSC x GDSC]
Reactjs Basics
ASP .Net Core SPA Templates
GDG Workshop on React (By Aakanksha Rai)
mern _stack _power _point_ presentation(1)
What is Server-side Rendering? How to Render Your React App on the Server-sid...
React JS .NET
Advanced Web Technology.pptx
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
An Overview of the React Ecosystem
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
Installing Webpack with React JS from Scratch.pdf
Introduction to angular | Concepts and Environment setup
Web summit.pptx
PWA - The Future of eCommerce - Magento Meetup Ahmedabad 2018
Making Of PHP Based Web Application
Revolutionizing Web Development with React Server Components: A Comprehensive...
Mastering react with redux
Full Stack React Workshop [CSSC x GDSC]
Ad

More from zmulani8 (20)

PPTX
Chapter-9-MySQL.pptxxzrtyryrydfdsfdsfdsrter
PPTX
unit 2 Mastering-State-Management-in-React.pptx
PPTX
Lect 4.pptxdsdsdsdfgxgf xzffss sdsdsffff
PPTX
sql functions.pptxghghghghghghghbvnbghjj
PPTX
session_2_sqlpptxfhfhfhfdhfdhkkfdhfdhfdh
PPTX
unit_1_foss_2.pptxbfhfdhfgsdgtsdegtsdtetg
PPTX
unit_1_spring_1.pptxfgfgggjffgggddddgggg
PPTX
spring aop.pptx aspt oreinted programmin
PPTX
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
PPTX
Some more Concepts of DOT cvcvcvNET.pptx
PPTX
DOT NET Framework.pptxdsfdsfdsfsdfdsfdsfdsf
PDF
ipsec.pdfgvdgvdgdgdgddgdgdgdgdgdgdgdgdgd
PPT
unit 2 intr to phy layer part 1.pptcvcvcv
PPT
JSP 1.pptdfdfdfdsfdsfdsfdsfdsgdgdgdgdgdd
PPTX
swing_compo.pptxsfdsfffdfdfdfdgwrwrwwtry
PPT
introduction.pptdasdasdadasdasdsddsdsads
PPTX
PE introd.pptxdsdsdsdasdsdsddadqwdqwdqwdqw
PPTX
Pre_requisties of ML Lect 1.pptxvcbvcbvcbvcb
PPTX
introduction TO DS 1.pptxvbvcbvcbvcbvcbvcb
PPTX
IANSunit 1_cryptography_2.pptxv xvxvxvxv
Chapter-9-MySQL.pptxxzrtyryrydfdsfdsfdsrter
unit 2 Mastering-State-Management-in-React.pptx
Lect 4.pptxdsdsdsdfgxgf xzffss sdsdsffff
sql functions.pptxghghghghghghghbvnbghjj
session_2_sqlpptxfhfhfhfdhfdhkkfdhfdhfdh
unit_1_foss_2.pptxbfhfdhfgsdgtsdegtsdtetg
unit_1_spring_1.pptxfgfgggjffgggddddgggg
spring aop.pptx aspt oreinted programmin
matplotlib.pptxdsfdsfdsfdsdsfdsdfdsfsdf cvvf
Some more Concepts of DOT cvcvcvNET.pptx
DOT NET Framework.pptxdsfdsfdsfsdfdsfdsfdsf
ipsec.pdfgvdgvdgdgdgddgdgdgdgdgdgdgdgdgd
unit 2 intr to phy layer part 1.pptcvcvcv
JSP 1.pptdfdfdfdsfdsfdsfdsfdsgdgdgdgdgdd
swing_compo.pptxsfdsfffdfdfdfdgwrwrwwtry
introduction.pptdasdasdadasdasdsddsdsads
PE introd.pptxdsdsdsdasdsdsddadqwdqwdqwdqw
Pre_requisties of ML Lect 1.pptxvcbvcbvcbvcb
introduction TO DS 1.pptxvbvcbvcbvcbvcbvcb
IANSunit 1_cryptography_2.pptxv xvxvxvxv
Ad

Recently uploaded (20)

PDF
IGGE1 Understanding the Self1234567891011
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Indian roads congress 037 - 2012 Flexible pavement
PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Classroom Observation Tools for Teachers
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
Lesson notes of climatology university.
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
RMMM.pdf make it easy to upload and study
PDF
Trump Administration's workforce development strategy
PPTX
Digestion and Absorption of Carbohydrates, Proteina and Fats
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Introduction to Building Materials
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
IGGE1 Understanding the Self1234567891011
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Indian roads congress 037 - 2012 Flexible pavement
Unit 4 Skeletal System.ppt.pptxopresentatiom
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Supply Chain Operations Speaking Notes -ICLT Program
Classroom Observation Tools for Teachers
UNIT III MENTAL HEALTH NURSING ASSESSMENT
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Lesson notes of climatology university.
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
RMMM.pdf make it easy to upload and study
Trump Administration's workforce development strategy
Digestion and Absorption of Carbohydrates, Proteina and Fats
Weekly quiz Compilation Jan -July 25.pdf
Introduction to Building Materials
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...

NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg

  • 1. NEXT.J S • Next.js is a flexible React framework that gives you building blocks to create fast web applications. 1
  • 2. INTRODUCTION 2 Server-Side Rendering (SSR) is a technique that allows your web application to pre-render HTML on a server, providing faster load times and a better user experience. In this tutorial, we'll cover Next.js, a framework for building server-rendered React applications.
  • 3. WhyUse SSR? SSR can improve SEO, performance, and user experience. It allows search engines to better crawl your site, reduces the time to first paint, and provides users with a fully rendered page on the initial load. Next.js simplifies the process of building SSR applications. 3
  • 4. GETTING STARTED WITH NEXT.JS 4 To get started with Next.js, you'll need to install it and create a new project. Next.js provides several built-in features, such as dynamic imports, automatic code splitting, and server-side rendering. You can also easily add custom routes and API endpoints.
  • 5. To build pages with Next.js, you'll create a pages directory and add React components for each page. Next.js uses getInitialProps to fetch data and render the page on the server. You can also use dynamic routing and static site generation to optimize performance. 5 BUILDING PAGESWITH NEXT.JS
  • 6. Deployin g Your Next.js App Next.js makes it easy to deploy your app to Vercel, a cloud platform for static and serverless sites. Vercel provides automatic SSL, custom domains, and global CDN. You can also deploy to other platforms such as Heroku or AWS. 6 Deploying Your Next.js App
  • 7. CONCLUSION Next.js provides a powerful framework for building server-rendered React applications. By using SSR, you can improve SEO, performance, and user experience. With Next.js, you can easily create dynamic routes, API endpoints, and deploy your app to the cloud. Keep learning and building! 7
  • 8. Building Blocks of a Web Application • User Interface - how users will consume and interact with your application. • Routing - how users navigate between different parts of your application. • Data Fetching - where your data lives and how to get it. • Rendering - when and where you render static or dynamic content. • Integrations - what third-party services you use (CMS, auth, payments, etc) and how you connect to them. • Infrastructure - where you deploy, store, and run your application code (Serverless, CDN, Edge, etc). • Performance - how to optimize your application for end-users. • Scalability - how your application adapts as your team, data, and traffic grow. • Developer Experience - your team’s experience building and maintaining your 9
  • 9. React ? Interactive User Interface • JavaScript library for building interactive user interfaces. • User interfaces, - users see and interact wit h Elements that on- screen. • Library - React provides helpful functions to build UI, but leaves it up to the developer where to use those functions in their application. 10
  • 10. Next.js? • React frameworkthat gives you building blocks to create web applications. • Framework - Next.js handles the tooling and configuration needed for React, and provides additional structure, features, and optimizations for your application. 1
  • 11. From JavaScript to React 12
  • 14. UI update with JavaScript • Create new file index.html // Select the div element with 'app' id // Create a new H1 element // Create a new text node for the H1 element // Append the text to the H1 element // Place the H1 element inside the div <html> <body> <div id="app"></div> <script type="text/javascript"> const app = document.getElementById('app'); const header = document.createElement('h1'); const headerContent = document.createTextNode( 'Develop. Preview. Ship.', ); header.appendChild(headerContent); app.appendChild(header); </script> </body> </html> 15
  • 15. Imperative vs Declarative Programming • Imperative programming is like giving a chef step-by-step instructions on how to make a pizza. • Declarative programming is like ordering a pizza without being concerned about the steps it takes to make the pizza. • React is a Declarative Library
  • 16. Imperative vs Declarative Programming • Imperative programming is like giving a chef step-by-step instructions on how to make a pizza. • Declarative programming is like ordering a pizza without being concerned about the steps it takes to make the pizza. • React is a Declarative Library
  • 17. Getting Started with React • To use React in your project, you can load two React scripts from an external website called unpkg.com: • react is the core React library. • react-dom provides DOM- specific methods that enable you to use React with the DOM. <!-- index.html --> <html> <body> <div id="app"></div> <script src="https://unpkg.com/react@17/umd/r eact.dev elopment.js"></script> <script src="https://unpkg.com/react- dom@17/umd/react- dom.development.js"></script> <script type="text/javascript"> const app = document.getElementById('app'); </script> </body> </html> 18
  • 18. Rendering React • Instead of directly manipulating the DOM with plain JavaScript, you can use ReactDOM.render( ) th e metho d from react-domto tell React to <h1 > render our title inside our #ap p element . <!-- index.html --> <html> <body> <div id="app"></div> <script src="https://unpkg.com/react@17/umd/r eact.dev elopment.js"></script> <script src="https://unpkg.com/react- dom@17/umd/react- dom.development.js"></script> <script type="text/javascript"> const app = document.getElementById('app'); ReactDOM.render(<h1>Develop. Preview. Ship. </h1>, app); </script> </body> </html> 18
  • 19. JSX- JavaScript Syntax Extension • JSX is a syntax extension for JavaScript that allows you to describe your UI in a HTML- like familiar syntax. • The nice thing about JSX is that apart from following three JSX rules, you don’t need to learn any new symbols or syntax outside of HTML and JavaScript. • Note that browsers don’t understand JSX out of the box, so you’ll need a JavaScript compiler, such as a Babel, to transform your JSX code into regular JavaScript. <html> <body> <div id="app"></div> <script src=" https://unpkg.com/react@17/umd/react.developm ent.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.j s"></script> <script type="text/jsx"> const app = document.getElementById('app'); ReactDOM.render(<h1>Develop. Preview. Ship. </h1>, app); </script> </body> </html> 19
  • 22. Starting with Next.js Node.j s 22 package.json { } npm install react react-dom next • Install • create a new file called with an empty object • In your terminal, run • Remov e react and react-dom scripts since you’ve installed them with NPM. <html> and <body> tags because Next.js will create these for you. ReactDom.render() Babel script • The • The • The code that interacts with app element and method. • The because Next.js has a compiler that transforms JSX into valid JavaScript browsers can understand. <script type="text/jsx"> • The tag. • The React. part of the React.useState(0) function
  • 23. // index.html import { useState } from 'react’; function Header({ title }) { return <h1>{title ? title : 'Default title'}</h1>; } function HomePage() { const names = ['Ada Lovelace', 'Grace Hopper', 'Margaret Hamilton’]; const [likes, setLikes] = useState(0); function handleClick() { setLikes(likes + 1); } return ( <div> <Header title="Develop. Preview. Ship. " /> <ul> {names.map((name) => ( <li key={name}>{name}</li> ))} </ul> <button onClick={handleClick}>Like ({likes})</button> </div> ); }
  • 24. Changing Environment page s 1. Move the index.js file to a new folder called (more on this later). default export 2. Add to your main React component to help Next.js distinguish which component to render as the main component of this page. export default function HomePage() { package.jso n Add a script to your file to run the Next.js development server while you develop. // package.json { "scripts": { "dev": "next dev" }, // "dependencies": { // "next": "^11.1.0", // "react": "^17.0.2", // "react- dom": "^17.0.2" // } }
  • 25. Running the development server import { useState } from 'react’; function Header({ title }) { return <h1>{title ? title : 'Default title'}</h1>; } export default function HomePage() { const names = ['Ada Lovelace', 'Grace Hopper', 'Margaret Hamilton’]; const [likes, setLikes] = useState(0); function handleClick() { setLikes(likes + 1); } return ( <div> <Header title="Develop. Preview. Ship. " /> <ul> {names.map((name) => ( <li key={name}>{name}</li > ))} npm run dev