React Introduction 2
React Introduction 2
REACT.JS
TABLE OF CONTENT
• Installation • Compositio
n
Overview
WHAT IS REACT.JS?
Open-
source
Declarative
• Encapsulated components
that manage their own
state.
• Keep state out of the
DOM.
Native support
• Compose rich mobile UI in
Android, iOS.
Isomorphic
cd my- npm
app start
• Documentation
https://reactjs.org/docs/
installation.html
React App Structure
React.createElement("div",
{ className: “yellow" },
"Children Content" [, …]);
LIST OF CHILDREN
Composition
• React components can be nested, like DOM
function Welcome() { elements
return <h1>Welcome</h1>;
}
function Goodbye() {
return <h1>Goodbye</h1>;
}
function ComponentBlender() {
return (
<div>
<Welcome />
<Goodbye />
</div> ReactDOM.render(<ComponentBlender
);} />,
document.getElementById('root
Advantages
• Encapsulate logic.
• Separate your code.
- Easier to maintain and
debug.
- Allows reusability.
• Components are neat.
Summary
• React is a JavaScript library
for building user
interfaces.