SlideShare a Scribd company logo
1 of 35
REACT JS
INTRODUCTION
CONTENT
• Introduction React JS and JSX
• Component, State, Props.
• Life Cycle of Component
• Pros & Cos
• Demonstration
WHAT IS REACT?
• A JavaScript Library For Building User Interfaces
• Renders your UI and responds to events.
• It also uses the concept called Virtual DOM, creates an in-memory data structure
cache, enumerates the resulting differences, and then updates the browser’s
displayed DOM efficiently.
• One of the unique features of React.js is not only it can perform on the client side, but
it can also be rendered on the server side, and they can work together interoperably.
Angular has
• modules
• controllers
• directives
• scopes
• templating
• linking functions
• filters
• dependency injection
WHAT IS REACT?
Angular has JUST COMPONENT
• modules
• controllers
• directives
• scopes
• templating
• linking functions
• filters
• dependency injection
WHAT IS REACT?
#2 Single Source of Truth
MVC proposes that your Model
is the single source of truth—
 all state lives there. Views
are derived from the Model,
and must be kept in sync.
When the Model changes, so
does the View.
WHAT IS REACT?
#2 Single Source of Truth
MVC proposes that your Model
is the single source of truth—
 all state lives there. Views
are derived from the Model,
and must be kept in sync.
When the Model changes, so
does the View.
WHAT IS REACT?
I AM DOUBLE-EDGED SWORD
#2 Single Source of Truth
MVC proposes that your Model
is the single source of truth—
 all state lives there. Views
are derived from the Model,
and must be kept in sync.
When the Model changes, so
does the View.
WHAT IS REACT?
I AM DOUBLE-EDGED SWORD
Only render when state
changed
WHAT IS REACT? – VIRTUAL DOM
• Manipulate DOM is high cost.
• React first assembles the entire structure
of your app in-memory, using those
objects. Then, it converts that structure
into actual DOM nodes and inserts them
in your browser’s DOM.
WHAT IS REACT? – VIRTUAL DOM
<script>
var helloEl = React.createElement(
'div',
{ className: 'hello' },
'Hello, world!‘
);
React.render(helloEl,document.body);
</script>
JSX
• JSX = Javascript + XML.
const element = <h1>Hello, world!</h1>;
JSX
<script>
var helloEl = React.createElement('div', { className: 'hello' }, 'Hello,
world!');
React.render(
helloEl,
document.body
);
</script>
<script type="text/jsx">
var helloEl = <div className: "hello">Hello, world!</div>;
React.render(
helloEl,
document.body
);
</script>
JSX
<script>
var helloEl = React.createElement('div', { className: 'hello' }, 'Hello,
world!');
React.render(
helloEl,
document.body
);
</script>
<script type="text/jsx">
var helloEl = <div className: "hello">Hello, world!</div>;
React.render(
helloEl,
document.body
);
</script>
COMPONENT
• Components let you split the UI into independent, reusable pieces, and think about
each piece in isolation.
• Conceptually, components are like JavaScript functions. They accept arbitrary inputs
(called "props") and return React elements describing what should appear on the
screen.
COMPONENT
class TodoInput extends React.Component {
render() {
return (
<div className="form-inline">
<input className="form-control" type="text" value={this.state.content}
onChange={this.updateState}/>
</div>
);
}
}
COMPONENT - PROPS
• Props is what you pass into the Component via attributes.
• Props is the only way to input data. (Or you can use Redux).
• Props are immutable.
• Container component will define data that can be changed
• Child Component will received data from parent component via props.
COMPONENT - PROPS
import React from 'react';
class App extends React.Component {
render() {
return (
<div>
<h1>{this.props.headerProp}</h1>
<h2>{this.props.contentProp}</h2>
</div>
);
}
}
export default App;
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.jsx';
ReactDOM.render(
<App headerProp="Header from props..."
contentProp="Content from props..."/>,
document.getElementById('app')
);
export default App;
COMPONENT - STATE
• Private data of component
• When change -> Re-render Component
• Can’t read from outside Component
COMPONENT - STATE
class TodoInput extends React.Component {
constructor(props) {
super(props); //Call this function because 'this' is not allowed before super().
this.state = {
content: ''
};
this.addTodo = this.addTodo.bind(this);
}
updateState(e) {
this.setState({content: e.target.value});
}
addTodo() {
// We of course not declare onSave function of this component at parent component
// Refer to: Body.jsx for more information
// We declare this onSave at mapDispatchToProps function
this.props.onSave.call(this, this.state.content, this.props.todo && this.props.todo.id || null);
this.setState({
content: ''
})
}
render() {
return (
<div className="form-inline">
<div className="form-group">
<input className="form-control" type="text" value={this.state.content} onChange={this.updateState}/>
</div>
</div>
);
}
}
class TodoInput extends React.Component {
constructor(props) {
super(props); //Call this function because 'this' is not allowed before super().
this.state = {
content: ''
};
this.addTodo = this.addTodo.bind(this);
}
updateState(e) {
this.setState({content: e.target.value});
}
addTodo() {
// We of course not declare onSave function of this component at parent component
// Refer to: Body.jsx for more information
// We declare this onSave at mapDispatchToProps function
this.props.onSave.call(this, this.state.content, this.props.todo && this.props.todo.id || null);
this.setState({
content: ''
})
}
render() {
return (
<div className="form-inline">
<div className="form-group">
<input className="form-control" type="text" value={this.state.content} onChange={this.updateState}/>
</div>
</div>
);
}
}
REACT COMPONENT LIFECYCLE
• React enables to create components by invoking the React.createClass() method
which expects a render method and triggers a lifecycle that can be hooked into via a
number of so called lifecycle methods.
• This short article should shed light into all the applicable functions.
• Understanding the component lifecycle will enable you to perform certain actions
when a component is created or destroyed. Further more it gives you the
opportunity to decide if a component should be updated in the first place and to
react to props or state changes accordingly.
THE LIFECYCLE -
INITIALIZATION
• Occurs when the component is created.
var Greeting = React.createClass({
propTypes: {
name: React.PropTypes.string
},
getDefaultProps: function () {
return {
name: 'Mary'
};
},
getInitialState: function () {
return {
helloSentence: 'Hello'
}
}
// ...
});
THE LIFECYCLE -
INITIALIZATION
• getDefaultProps and getInitialState not exists when
define Component as Class ES6.
Greeting.defaultProps = {
name: 'Mary'
};
constructor(props){
super(props);
this.state = {
name: 'Mary'
}
}
THE LIFECYCLE -
INITIALIZATION
• Inside ComponentWillMount, setting state won’t
trigger re-render whole component.
• We CAN NOT modify state in render method.
• DOM Manipulation is only permitted inside
componentDidMount method.
THE LIFECYCLE -
STATE CHANGES
• Occur when state is changed (via this.setState(..))
except inside componentWillMount methods
shouldComponentUpdate: function(nextProps, nextState){
// return a boolean value
return true;
}
• shouldComponentUpdate returning false results in
followed methods won’t be triggerd also.
• shouldComponentUpdate won’t triggered in the
initial phase or when call forceUpdate().
• Current State of Component DID NOT have new
value,
THE LIFECYCLE -
PROPS CHANGES
• Occurs when data passed from parent component to
child component changed (via props).
• Changing states in ComponentWillReceiveProps DID
NOT trigger re-render component.
componentWillReceiveProps: function(nextProps)
{
this.setState({
// set something
});
}
Props Change  componentWillReceiveProps trigged
Props Change  componentWillReceiveProps trigged
NOT
THE LIFECYCLE -
UNMOUNTING
• Used to clean up data
PROS & COS OF REACT.JS
THE GOOD POINTS:
• React.js is extremely efficient
- Virtual DOM
• It makes writing Javascript easier
- React.js uses a special syntax called JSX
• It gives you out-of-the-box developer
tools
- React.js chrome extension
• It’s awesome for SEO
- Server rendering
• UI Test Cases
THE BAD:
• React.js is only a view layer.
• There is a learning curve for beginners
who are new to web development.
• Library size. (~ Angular)
Why you should use React.js:
• React.js works great for teams, strongly enforcing UI and workflow patterns.
• The user interface code is readable and maintainable.
• Componentized UI is the future of web development, and you need to start doing it
now.
• And also, there is now a lot of demand for developers with ReactJS experience.
Why you should NOT use React.js:
• Slow you down tremendously at the start.
• You will reinvent a lot of wheels.
• Flux/Redux
• React Native
OUR NEXT STEPS
REFERENCES
• https://firstdoit.com/how-i-learned-to-stop-worrying-and-love-react-
4e22b0bb6c2a#.vt2mjxu6s
• https://offroadcode.com/journal/news/reactjs-whats-it-all-about/
• http://sixrevisions.com/javascript/why-i-ditched-angular-for-react/
• https://github.com/hpphat92/my-todo-reactjs
• https://hpphat.wordpress.com/category/web-dev/react/
• http://blog.andrewray.me/reactjs-for-stupid-people/
• 192.168.1.240sharePhat.HongReactjs
[Final] ReactJS presentation
[Final] ReactJS presentation

More Related Content

What's hot (20)

Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
React js for beginners
React js for beginnersReact js for beginners
React js for beginners
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React js
React jsReact js
React js
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
React-JS Component Life-cycle Methods
React-JS Component Life-cycle MethodsReact-JS Component Life-cycle Methods
React-JS Component Life-cycle Methods
 
React hooks
React hooksReact hooks
React hooks
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React workshop
React workshopReact workshop
React workshop
 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React Router
 
reactJS
reactJSreactJS
reactJS
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
 
React js
React jsReact js
React js
 
Vue.js
Vue.jsVue.js
Vue.js
 
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 

Viewers also liked

Kuali Identity Management - Introduction And Implementation Options
Kuali Identity Management - Introduction And Implementation OptionsKuali Identity Management - Introduction And Implementation Options
Kuali Identity Management - Introduction And Implementation OptionsEric Westfall
 
React Component Library Design @WalmartLabs
React Component Library Design @WalmartLabsReact Component Library Design @WalmartLabs
React Component Library Design @WalmartLabschaseadamsio
 
React js - Component specs and lifecycle
React js - Component specs and lifecycleReact js - Component specs and lifecycle
React js - Component specs and lifecycleDoanh PHAM
 
Building React Applications with Redux
Building React Applications with ReduxBuilding React Applications with Redux
Building React Applications with ReduxFITC
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux IntroductionNikolaus Graf
 
React – Structure Container Component In Meteor
 React – Structure Container Component In Meteor React – Structure Container Component In Meteor
React – Structure Container Component In MeteorDesignveloper
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practicesfloydophone
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesomeAndrew Hull
 

Viewers also liked (10)

Kuali Identity Management - Introduction And Implementation Options
Kuali Identity Management - Introduction And Implementation OptionsKuali Identity Management - Introduction And Implementation Options
Kuali Identity Management - Introduction And Implementation Options
 
React Component Library Design @WalmartLabs
React Component Library Design @WalmartLabsReact Component Library Design @WalmartLabs
React Component Library Design @WalmartLabs
 
React js - Component specs and lifecycle
React js - Component specs and lifecycleReact js - Component specs and lifecycle
React js - Component specs and lifecycle
 
Using redux
Using reduxUsing redux
Using redux
 
Building React Applications with Redux
Building React Applications with ReduxBuilding React Applications with Redux
Building React Applications with Redux
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
React – Structure Container Component In Meteor
 React – Structure Container Component In Meteor React – Structure Container Component In Meteor
React – Structure Container Component In Meteor
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
 
learning react
learning reactlearning react
learning react
 

Similar to [Final] ReactJS presentation

React and Flux life cycle with JSX, React Router and Jest Unit Testing
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit TestingEswara Kumar Palakollu
 
React Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptxReact Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptxBOSC Tech Labs
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionVisual Engineering
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs[T]echdencias
 
Reactивная тяга
Reactивная тягаReactивная тяга
Reactивная тягаVitebsk Miniq
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsJeff Durta
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today Nitin Tyagi
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsJeff Durta
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React TogetherSebastian Pederiva
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react jsdhanushkacnd
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react jsStephieJohn
 

Similar to [Final] ReactJS presentation (20)

Intro react js
Intro react jsIntro react js
Intro react js
 
React and Flux life cycle with JSX, React Router and Jest Unit Testing
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit Testing
 
ReactJS
ReactJSReactJS
ReactJS
 
React Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptxReact Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptx
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS Introduction
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs
 
Reactивная тяга
Reactивная тягаReactивная тяга
Reactивная тяга
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
React js
React jsReact js
React js
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 
React outbox
React outboxReact outbox
React outbox
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React Together
 
ReactJS (1)
ReactJS (1)ReactJS (1)
ReactJS (1)
 
React lecture
React lectureReact lecture
React lecture
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
 
Simple React Todo List
Simple React Todo ListSimple React Todo List
Simple React Todo List
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 

[Final] ReactJS presentation

  • 2. CONTENT • Introduction React JS and JSX • Component, State, Props. • Life Cycle of Component • Pros & Cos • Demonstration
  • 3. WHAT IS REACT? • A JavaScript Library For Building User Interfaces • Renders your UI and responds to events. • It also uses the concept called Virtual DOM, creates an in-memory data structure cache, enumerates the resulting differences, and then updates the browser’s displayed DOM efficiently. • One of the unique features of React.js is not only it can perform on the client side, but it can also be rendered on the server side, and they can work together interoperably.
  • 4. Angular has • modules • controllers • directives • scopes • templating • linking functions • filters • dependency injection WHAT IS REACT?
  • 5. Angular has JUST COMPONENT • modules • controllers • directives • scopes • templating • linking functions • filters • dependency injection WHAT IS REACT?
  • 6. #2 Single Source of Truth MVC proposes that your Model is the single source of truth—  all state lives there. Views are derived from the Model, and must be kept in sync. When the Model changes, so does the View. WHAT IS REACT?
  • 7. #2 Single Source of Truth MVC proposes that your Model is the single source of truth—  all state lives there. Views are derived from the Model, and must be kept in sync. When the Model changes, so does the View. WHAT IS REACT? I AM DOUBLE-EDGED SWORD
  • 8. #2 Single Source of Truth MVC proposes that your Model is the single source of truth—  all state lives there. Views are derived from the Model, and must be kept in sync. When the Model changes, so does the View. WHAT IS REACT? I AM DOUBLE-EDGED SWORD Only render when state changed
  • 9. WHAT IS REACT? – VIRTUAL DOM • Manipulate DOM is high cost. • React first assembles the entire structure of your app in-memory, using those objects. Then, it converts that structure into actual DOM nodes and inserts them in your browser’s DOM.
  • 10. WHAT IS REACT? – VIRTUAL DOM <script> var helloEl = React.createElement( 'div', { className: 'hello' }, 'Hello, world!‘ ); React.render(helloEl,document.body); </script>
  • 11. JSX • JSX = Javascript + XML. const element = <h1>Hello, world!</h1>;
  • 12. JSX <script> var helloEl = React.createElement('div', { className: 'hello' }, 'Hello, world!'); React.render( helloEl, document.body ); </script> <script type="text/jsx"> var helloEl = <div className: "hello">Hello, world!</div>; React.render( helloEl, document.body ); </script>
  • 13. JSX <script> var helloEl = React.createElement('div', { className: 'hello' }, 'Hello, world!'); React.render( helloEl, document.body ); </script> <script type="text/jsx"> var helloEl = <div className: "hello">Hello, world!</div>; React.render( helloEl, document.body ); </script>
  • 14. COMPONENT • Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. • Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called "props") and return React elements describing what should appear on the screen.
  • 15.
  • 16.
  • 17. COMPONENT class TodoInput extends React.Component { render() { return ( <div className="form-inline"> <input className="form-control" type="text" value={this.state.content} onChange={this.updateState}/> </div> ); } }
  • 18. COMPONENT - PROPS • Props is what you pass into the Component via attributes. • Props is the only way to input data. (Or you can use Redux). • Props are immutable. • Container component will define data that can be changed • Child Component will received data from parent component via props.
  • 19. COMPONENT - PROPS import React from 'react'; class App extends React.Component { render() { return ( <div> <h1>{this.props.headerProp}</h1> <h2>{this.props.contentProp}</h2> </div> ); } } export default App; import React from 'react'; import ReactDOM from 'react-dom'; import App from './App.jsx'; ReactDOM.render( <App headerProp="Header from props..." contentProp="Content from props..."/>, document.getElementById('app') ); export default App;
  • 20. COMPONENT - STATE • Private data of component • When change -> Re-render Component • Can’t read from outside Component
  • 21. COMPONENT - STATE class TodoInput extends React.Component { constructor(props) { super(props); //Call this function because 'this' is not allowed before super(). this.state = { content: '' }; this.addTodo = this.addTodo.bind(this); } updateState(e) { this.setState({content: e.target.value}); } addTodo() { // We of course not declare onSave function of this component at parent component // Refer to: Body.jsx for more information // We declare this onSave at mapDispatchToProps function this.props.onSave.call(this, this.state.content, this.props.todo && this.props.todo.id || null); this.setState({ content: '' }) } render() { return ( <div className="form-inline"> <div className="form-group"> <input className="form-control" type="text" value={this.state.content} onChange={this.updateState}/> </div> </div> ); } } class TodoInput extends React.Component { constructor(props) { super(props); //Call this function because 'this' is not allowed before super(). this.state = { content: '' }; this.addTodo = this.addTodo.bind(this); } updateState(e) { this.setState({content: e.target.value}); } addTodo() { // We of course not declare onSave function of this component at parent component // Refer to: Body.jsx for more information // We declare this onSave at mapDispatchToProps function this.props.onSave.call(this, this.state.content, this.props.todo && this.props.todo.id || null); this.setState({ content: '' }) } render() { return ( <div className="form-inline"> <div className="form-group"> <input className="form-control" type="text" value={this.state.content} onChange={this.updateState}/> </div> </div> ); } }
  • 22. REACT COMPONENT LIFECYCLE • React enables to create components by invoking the React.createClass() method which expects a render method and triggers a lifecycle that can be hooked into via a number of so called lifecycle methods. • This short article should shed light into all the applicable functions. • Understanding the component lifecycle will enable you to perform certain actions when a component is created or destroyed. Further more it gives you the opportunity to decide if a component should be updated in the first place and to react to props or state changes accordingly.
  • 23. THE LIFECYCLE - INITIALIZATION • Occurs when the component is created. var Greeting = React.createClass({ propTypes: { name: React.PropTypes.string }, getDefaultProps: function () { return { name: 'Mary' }; }, getInitialState: function () { return { helloSentence: 'Hello' } } // ... });
  • 24. THE LIFECYCLE - INITIALIZATION • getDefaultProps and getInitialState not exists when define Component as Class ES6. Greeting.defaultProps = { name: 'Mary' }; constructor(props){ super(props); this.state = { name: 'Mary' } }
  • 25. THE LIFECYCLE - INITIALIZATION • Inside ComponentWillMount, setting state won’t trigger re-render whole component. • We CAN NOT modify state in render method. • DOM Manipulation is only permitted inside componentDidMount method.
  • 26. THE LIFECYCLE - STATE CHANGES • Occur when state is changed (via this.setState(..)) except inside componentWillMount methods shouldComponentUpdate: function(nextProps, nextState){ // return a boolean value return true; } • shouldComponentUpdate returning false results in followed methods won’t be triggerd also. • shouldComponentUpdate won’t triggered in the initial phase or when call forceUpdate(). • Current State of Component DID NOT have new value,
  • 27. THE LIFECYCLE - PROPS CHANGES • Occurs when data passed from parent component to child component changed (via props). • Changing states in ComponentWillReceiveProps DID NOT trigger re-render component. componentWillReceiveProps: function(nextProps) { this.setState({ // set something }); } Props Change  componentWillReceiveProps trigged Props Change  componentWillReceiveProps trigged NOT
  • 28. THE LIFECYCLE - UNMOUNTING • Used to clean up data
  • 29. PROS & COS OF REACT.JS THE GOOD POINTS: • React.js is extremely efficient - Virtual DOM • It makes writing Javascript easier - React.js uses a special syntax called JSX • It gives you out-of-the-box developer tools - React.js chrome extension • It’s awesome for SEO - Server rendering • UI Test Cases THE BAD: • React.js is only a view layer. • There is a learning curve for beginners who are new to web development. • Library size. (~ Angular)
  • 30. Why you should use React.js: • React.js works great for teams, strongly enforcing UI and workflow patterns. • The user interface code is readable and maintainable. • Componentized UI is the future of web development, and you need to start doing it now. • And also, there is now a lot of demand for developers with ReactJS experience.
  • 31. Why you should NOT use React.js: • Slow you down tremendously at the start. • You will reinvent a lot of wheels.
  • 32. • Flux/Redux • React Native OUR NEXT STEPS
  • 33. REFERENCES • https://firstdoit.com/how-i-learned-to-stop-worrying-and-love-react- 4e22b0bb6c2a#.vt2mjxu6s • https://offroadcode.com/journal/news/reactjs-whats-it-all-about/ • http://sixrevisions.com/javascript/why-i-ditched-angular-for-react/ • https://github.com/hpphat92/my-todo-reactjs • https://hpphat.wordpress.com/category/web-dev/react/ • http://blog.andrewray.me/reactjs-for-stupid-people/ • 192.168.1.240sharePhat.HongReactjs