SlideShare uma empresa Scribd logo
1 de 14
Ayes Chinmay
Internet
&
Web Technology
(React.js)
IWT Syllabus:
Module 3:
XML
Introduction to XML, XML vs HTML, Structures of a XML Document, Document Type Declaration (DTD),
XML Validation, Well Formed XML Documents, Valid XML Document, XML DOM, XSL, XSL ransformation,
XML Namespaces, XML Schema.
AJAX
AJAX Introduction, AJAX - The XMLHttpRequest Object, AJAX - Server Response, Ajax XML,
Ajax Database
jQuery
jQuery DOM Selectors, HTML Content, jQuery CSS Styles, jQuery HTML DOM
JSON
Introduction, syntax, Data Types, Parsing, Stringify, Object, Arrays
React.js
Introduction, ES6, Render HTML, JSX, Components , props, state, Lifecycle, Events, forms,
CSS
React.js:
 React is a JavaScript library created by Facebook.
 React is a JavaScript library for building user interfaces.
 React is used to build single page applications and used to create
reusable UI components.
 Released on 29th May, 2013. (7 years ago)
Jordan Walke
Install React.js:
 Install NPM (Node Package Manager)
 Install Sublime.
 Install React from Terminal:
a) npm install –g create-react-app
b) create-react-app --version
c) create-react-app <Project_Name>
React Directly in HTML:
<!DOCTYPE html>
<html>
<script
src="https://unpkg.com/react@16/umd/react.pr
oduction.min.js"></script>
<script src="https://unpkg.com/react-
dom@16/umd/react-
dom.production.min.js"></script>
<script src="https://unpkg.com/babel-
standalone@6.15.0/babel.min.js"></script>
<body>
<div id="mydiv"></div>
<script type="text/babel">
class Hello extends React.Component {
render() {
return <h1>Hello World!</h1>
}
}
ReactDOM.render(<Hello />,
document.getElementById('mydiv'))
</script>
</body>
</html>
Index.html
React Render HTML:
import React from 'react';
import ReactDOM from 'react-dom';
const myelement = (
<table>
<tr>
<th>Name</th>
</tr>
<tr>
<td>Ayes</td>
</tr>
<tr>
<td>Chinmay</td>
</tr>
</table>
);
ReactDOM.render(myelement,
document.getElementById('root'));
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport"
content="width=device-width, initial-
scale=1" />
<title>React App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
 The ReactDOM.render() function
takes two arguments, HTML code
and an HTML element.
 The purpose of the function is to
display the specified HTML code
inside the specified HTML
element.
Index.js
Index.html
React JSX:
import React from 'react';
import ReactDOM from 'react-dom';
const myelement = <h1>TEST!</h1>;
ReactDOM.render(myelement,
document.getElementById('root'));
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport"
content="width=device-width, initial-
scale=1" />
<title>React App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
 JSX stands for JavaScript XML.
 JSX allows us to write HTML in
React.
 JSX makes it easier to write
and add HTML in React.
Index.js
Index.html
Styling React Using CSS:
import React from 'react';
import ReactDOM from 'react-dom';
class MyHeader extends
React.Component {
render() {
const mystyle = {
color: "white",
backgroundColor: "DodgerBlue",
padding: "10px",
fontFamily: "Arial"
};
return (
<div>
<h1 style={mystyle}>Hello
Style!</h1>
<p>Add a little style!</p>
</div>
);
}
}
ReactDOM.render(<MyHeader />,
document.getElementById('root'));
Index.js
React Forms:
import React from 'react';
import ReactDOM from 'react-dom';
class MyForm extends React.Component {
constructor(props) {
super(props);
this.state = { username: '' };
}
myChangeHandler = (event) => {
this.setState({username:
event.target.value});
}
render() {
return (
<form>
<h1>Hello {this.state.username}</h1>
<p>Enter your name:</p>
<input
type='text'
onChange={this.myChangeHandler}
/>
</form>
);
}
}
ReactDOM.render(<MyForm />,
document.getElementById('root'));
Index.js
React Lifecycle:
 Each component in React has a
lifecycle which you can monitor
and manipulate during its three
main phases.
 The three phases are: Mounting,
Updating, and Unmounting.
 componentWillMount is executed before rendering, on both the server and the client
side.
 componentDidMount is executed after the first render only on the client side. This is
where AJAX requests and DOM or state updates should occur. This method is also used
for integration with other JavaScript frameworks and any functions with delayed
execution such as setTimeout or setInterval. We are using it to update the state so we
can trigger the other lifecycle methods.
 componentWillReceiveProps is invoked as soon as the props are updated before
another render is called. We triggered it from setNewNumber when we updated the
state.
 shouldComponentUpdate should return true or false value. This will determine if the
component will be updated or not. This is set to true by default. If you are sure that the
component doesn't need to render after state or props are updated, you can return
false value.
 componentWillUpdate is called just before rendering.
 componentDidUpdate is called just after rendering.
 componentWillUnmount is called after the component is unmounted from the dom.
We are unmounting our component in main.js.
Assignment:
CHECK THE RECORDED VIDEO
Model Questions:
1. The firewall is used for
(a) Sensing the size of the packet.
(b) Isolating intranet from extranet.
(c) Screening packets to/from the network and
filtering of network traffic.
(d) Isolating Internet from virtual LAN.
2. npm stands for ?
(a) Node Package Manager (b) Node Packet Manager
(c) Note Package Manager (d) Net Package Manager
Model Questions: (Cont.)
3. Which of the following inserts a comment in a CSS file?
(a) // this is a comment
(b) /* this is a comment */
(c) * this is a comment*
(d) “this is a comment”
4. How can we change the background colour?
(a) bgcolor:"newcolor"
(b) color=background (colorname)
(c) background-color:
(d) BGCOL="colorname"
Next Class:
Node.js

Mais conteúdo relacionado

Mais procurados

JavaScript DOM & event
JavaScript DOM & eventJavaScript DOM & event
JavaScript DOM & event
Borey Lim
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
Shawn Calvert
 
introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5
FLYMAN TECHNOLOGY LIMITED
 

Mais procurados (20)

Dom
DomDom
Dom
 
JavaScript
JavaScriptJavaScript
JavaScript
 
JavaScript DOM & event
JavaScript DOM & eventJavaScript DOM & event
JavaScript DOM & event
 
Javascript inside Browser (DOM)
Javascript inside Browser (DOM)Javascript inside Browser (DOM)
Javascript inside Browser (DOM)
 
Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
 
JS basics
JS basicsJS basics
JS basics
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 
Document Object Model (DOM)
Document Object Model (DOM)Document Object Model (DOM)
Document Object Model (DOM)
 
Java Script
Java ScriptJava Script
Java Script
 
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7
 
Suggest.js
Suggest.jsSuggest.js
Suggest.js
 
Web components
Web componentsWeb components
Web components
 
Java script programs
Java script programsJava script programs
Java script programs
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5
 
Java script
Java scriptJava script
Java script
 

Semelhante a Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology

react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
janet736113
 

Semelhante a Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology (20)

React js
React jsReact js
React js
 
ReactJS.pptx
ReactJS.pptxReactJS.pptx
ReactJS.pptx
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
React JS .NET
React JS .NETReact JS .NET
React JS .NET
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
Getting Started with React v16
Getting Started with React v16Getting Started with React v16
Getting Started with React v16
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and Symfony
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
 
React js t2 - jsx
React js   t2 - jsxReact js   t2 - jsx
React js t2 - jsx
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java Developers
 
Top 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptxTop 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptx
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
 
React Best Practices All Developers Should Follow in 2024.pdf
React Best Practices All Developers Should Follow in 2024.pdfReact Best Practices All Developers Should Follow in 2024.pdf
React Best Practices All Developers Should Follow in 2024.pdf
 

Mais de Ayes Chinmay

Mais de Ayes Chinmay (8)

Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
 
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web TechnologyInternet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
 
Internet and Web Technology (CLASS-5) [HTML DOM]
Internet and Web Technology (CLASS-5) [HTML DOM] Internet and Web Technology (CLASS-5) [HTML DOM]
Internet and Web Technology (CLASS-5) [HTML DOM]
 
Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS] Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS]
 
Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS] Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS]
 
Internet and Web Technology (CLASS-2) [HTTP & HTML]
Internet and Web Technology (CLASS-2) [HTTP & HTML]Internet and Web Technology (CLASS-2) [HTTP & HTML]
Internet and Web Technology (CLASS-2) [HTTP & HTML]
 
Internet and Web Technology (CLASS-1) [Introduction]
Internet and Web Technology (CLASS-1) [Introduction]Internet and Web Technology (CLASS-1) [Introduction]
Internet and Web Technology (CLASS-1) [Introduction]
 

Último

Último (20)

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 

Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology

  • 2. IWT Syllabus: Module 3: XML Introduction to XML, XML vs HTML, Structures of a XML Document, Document Type Declaration (DTD), XML Validation, Well Formed XML Documents, Valid XML Document, XML DOM, XSL, XSL ransformation, XML Namespaces, XML Schema. AJAX AJAX Introduction, AJAX - The XMLHttpRequest Object, AJAX - Server Response, Ajax XML, Ajax Database jQuery jQuery DOM Selectors, HTML Content, jQuery CSS Styles, jQuery HTML DOM JSON Introduction, syntax, Data Types, Parsing, Stringify, Object, Arrays React.js Introduction, ES6, Render HTML, JSX, Components , props, state, Lifecycle, Events, forms, CSS
  • 3. React.js:  React is a JavaScript library created by Facebook.  React is a JavaScript library for building user interfaces.  React is used to build single page applications and used to create reusable UI components.  Released on 29th May, 2013. (7 years ago) Jordan Walke
  • 4. Install React.js:  Install NPM (Node Package Manager)  Install Sublime.  Install React from Terminal: a) npm install –g create-react-app b) create-react-app --version c) create-react-app <Project_Name>
  • 5. React Directly in HTML: <!DOCTYPE html> <html> <script src="https://unpkg.com/react@16/umd/react.pr oduction.min.js"></script> <script src="https://unpkg.com/react- dom@16/umd/react- dom.production.min.js"></script> <script src="https://unpkg.com/babel- standalone@6.15.0/babel.min.js"></script> <body> <div id="mydiv"></div> <script type="text/babel"> class Hello extends React.Component { render() { return <h1>Hello World!</h1> } } ReactDOM.render(<Hello />, document.getElementById('mydiv')) </script> </body> </html> Index.html
  • 6. React Render HTML: import React from 'react'; import ReactDOM from 'react-dom'; const myelement = ( <table> <tr> <th>Name</th> </tr> <tr> <td>Ayes</td> </tr> <tr> <td>Chinmay</td> </tr> </table> ); ReactDOM.render(myelement, document.getElementById('root')); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial- scale=1" /> <title>React App</title> </head> <body> <div id="root"></div> </body> </html>  The ReactDOM.render() function takes two arguments, HTML code and an HTML element.  The purpose of the function is to display the specified HTML code inside the specified HTML element. Index.js Index.html
  • 7. React JSX: import React from 'react'; import ReactDOM from 'react-dom'; const myelement = <h1>TEST!</h1>; ReactDOM.render(myelement, document.getElementById('root')); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial- scale=1" /> <title>React App</title> </head> <body> <div id="root"></div> </body> </html>  JSX stands for JavaScript XML.  JSX allows us to write HTML in React.  JSX makes it easier to write and add HTML in React. Index.js Index.html
  • 8. Styling React Using CSS: import React from 'react'; import ReactDOM from 'react-dom'; class MyHeader extends React.Component { render() { const mystyle = { color: "white", backgroundColor: "DodgerBlue", padding: "10px", fontFamily: "Arial" }; return ( <div> <h1 style={mystyle}>Hello Style!</h1> <p>Add a little style!</p> </div> ); } } ReactDOM.render(<MyHeader />, document.getElementById('root')); Index.js
  • 9. React Forms: import React from 'react'; import ReactDOM from 'react-dom'; class MyForm extends React.Component { constructor(props) { super(props); this.state = { username: '' }; } myChangeHandler = (event) => { this.setState({username: event.target.value}); } render() { return ( <form> <h1>Hello {this.state.username}</h1> <p>Enter your name:</p> <input type='text' onChange={this.myChangeHandler} /> </form> ); } } ReactDOM.render(<MyForm />, document.getElementById('root')); Index.js
  • 10. React Lifecycle:  Each component in React has a lifecycle which you can monitor and manipulate during its three main phases.  The three phases are: Mounting, Updating, and Unmounting.  componentWillMount is executed before rendering, on both the server and the client side.  componentDidMount is executed after the first render only on the client side. This is where AJAX requests and DOM or state updates should occur. This method is also used for integration with other JavaScript frameworks and any functions with delayed execution such as setTimeout or setInterval. We are using it to update the state so we can trigger the other lifecycle methods.  componentWillReceiveProps is invoked as soon as the props are updated before another render is called. We triggered it from setNewNumber when we updated the state.  shouldComponentUpdate should return true or false value. This will determine if the component will be updated or not. This is set to true by default. If you are sure that the component doesn't need to render after state or props are updated, you can return false value.  componentWillUpdate is called just before rendering.  componentDidUpdate is called just after rendering.  componentWillUnmount is called after the component is unmounted from the dom. We are unmounting our component in main.js.
  • 12. Model Questions: 1. The firewall is used for (a) Sensing the size of the packet. (b) Isolating intranet from extranet. (c) Screening packets to/from the network and filtering of network traffic. (d) Isolating Internet from virtual LAN. 2. npm stands for ? (a) Node Package Manager (b) Node Packet Manager (c) Note Package Manager (d) Net Package Manager
  • 13. Model Questions: (Cont.) 3. Which of the following inserts a comment in a CSS file? (a) // this is a comment (b) /* this is a comment */ (c) * this is a comment* (d) “this is a comment” 4. How can we change the background colour? (a) bgcolor:"newcolor" (b) color=background (colorname) (c) background-color: (d) BGCOL="colorname"