SlideShare a Scribd company logo
July 5, 2015
Ilia Lobsanov
A gentle introduction
Objectives
• Build a user interface by diving into code
• Learn the basics of React
What’s React?
• A javascript library for building user interfaces
• Great for single-page applications
• Developed at Facebook/Instagram, open-sourced in
2013
• Used by Khan Academy, New York Times, Airbnb
The Basics
1 var HelloMessage = React.createClass({
2 render: function() {
3 return <div>Hello {this.props.name}</div>;
4 }
5 });
6
7 React.render(<HelloMessage name="John" />, mountNode);
The Basics
1 var HelloMessage = React.createClass({
2 render: function() {
3 return <div>Hello {this.props.name}</div>;
4 }
5 });
6
7 React.render(<HelloMessage name="John" />, mountNode);
The Interface
The Interface
FriendForm
FriendList
Friend
FriendBox
1 var Friend = React.createClass({
2 render: function() {
3 return (
4 <div className="friend">
5 <h2 className="name">
6 {this.props.name}
7 </h2>
8 </div>
9 );
10 }
11 });
1 var FriendList = React.createClass({
2 render: function() {
3 var friendNodes = this.props.data.map(function(friend) {
4 return (
5 <Friend name={friend.name}>
6 </Friend>
7 );
8 });
9
10 return (
11 <div className="friendList">
12 {friendNodes}
13 </div>
14 );
15 }
16 });
1 var FriendForm = React.createClass({
2 handleChange: function(e) {
3 e.preventDefault();
4 var name = React.findDOMNode(this.refs.name).value.trim();
5
6 this.props.onFriendChange({
7 name: name
8 });
9 },
10
11 render: function() {
12 return (
13 <form className="friendForm">
14 Name:
15 <input type="text" ref="name" onChange={this.handleChange}/>
16 </form>
17 );
18 }
19 });
1 var FriendBox = React.createClass({
2 loadFriendsFromServer: function(formData) {
3 $.get(this.props.url, formData, function(data) {
4 this.setState({ data: data.friends });
5 }.bind(this));
6 },
7
8 render: function() {
9 return (
10 <div className="friendBox">
11 <h1>Friend Finder</h1>
12 <FriendForm onFriendChange={this.loadFriendsFromServer} />
13 <FriendList data={this.state.data} />
14 </div>
15 );
16 }
17 });
1 var FriendBox = React.createClass({
2 loadFriendsFromServer: function(formData) {
3 $.get(this.props.url, formData, function(data) {
4 this.setState({ data: data.friends });
5 }.bind(this));
6 },
7
8 render: function() {
9 return (
10 <div className="friendBox">
11 <h1>Friend Finder</h1>
12 <FriendForm onFriendChange={this.loadFriendsFromServer} />
13 <FriendList data={this.state.data} />
14 </div>
15 );
16 }
17 });
More Info
• The app: http://friend-finder-react.herokuapp.com/
• Source Code: https://github.com/nurey/friend-finder

More Related Content

What's hot

Simple Singleton Java
Simple Singleton JavaSimple Singleton Java
Simple Singleton Java
Christian Hipolito
 
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Eric DeLabar
 
ITT Flisol 2013
ITT Flisol 2013ITT Flisol 2013
ITT Flisol 2013
Domingo Suarez Torres
 
Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017
AmarInfotech
 
jQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript TestingjQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript Testing
Vlad Filippov
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
Deepu S Nath
 
Getting Started with Angular - Stormpath Webinar, January 2017
Getting Started with Angular - Stormpath Webinar, January 2017Getting Started with Angular - Stormpath Webinar, January 2017
Getting Started with Angular - Stormpath Webinar, January 2017
Matt Raible
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
Omkarsoft Bangalore
 
Sfk13
Sfk13Sfk13
jQuery Mobile Overview - Boston
jQuery Mobile  Overview -  BostonjQuery Mobile  Overview -  Boston
jQuery Mobile Overview - Boston
Todd Parker
 
SGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page InterfaceSGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page Interface
Domingo Suarez Torres
 
Building a PWA with Ionic, Angular and Spring Boot - Jfokus 2017
Building a PWA with Ionic, Angular and Spring Boot - Jfokus 2017Building a PWA with Ionic, Angular and Spring Boot - Jfokus 2017
Building a PWA with Ionic, Angular and Spring Boot - Jfokus 2017
Matt Raible
 
Sxsw2013
Sxsw2013Sxsw2013
Sxsw2013
Jesse Cravens
 
React native - What, Why, How?
React native - What, Why, How?React native - What, Why, How?
React native - What, Why, How?
Teerasej Jiraphatchandej
 
jQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchAppsjQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchApps
Bradley Holt
 
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkBuilding a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
St. Petersburg College
 
Interoperability of components built with different frameworks
Interoperability of components built with different frameworksInteroperability of components built with different frameworks
Interoperability of components built with different frameworks
Souvik Basu
 
Upstate CSCI 450 jQuery
Upstate CSCI 450 jQueryUpstate CSCI 450 jQuery
Upstate CSCI 450 jQuery
DanWooster1
 
Developing java Web Applications Using Google Apps RJUG 2011
Developing java Web Applications Using Google Apps RJUG 2011Developing java Web Applications Using Google Apps RJUG 2011
Developing java Web Applications Using Google Apps RJUG 2011
Ted Husted
 
Whats New In Spring 3.0 ?
Whats New In Spring 3.0 ?Whats New In Spring 3.0 ?
Whats New In Spring 3.0 ?
Patrick Baumgartner
 

What's hot (20)

Simple Singleton Java
Simple Singleton JavaSimple Singleton Java
Simple Singleton Java
 
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...Natural Language UI Testing using Behavior Driven Development with Pavlov and...
Natural Language UI Testing using Behavior Driven Development with Pavlov and...
 
ITT Flisol 2013
ITT Flisol 2013ITT Flisol 2013
ITT Flisol 2013
 
Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017
 
jQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript TestingjQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript Testing
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
 
Getting Started with Angular - Stormpath Webinar, January 2017
Getting Started with Angular - Stormpath Webinar, January 2017Getting Started with Angular - Stormpath Webinar, January 2017
Getting Started with Angular - Stormpath Webinar, January 2017
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
 
Sfk13
Sfk13Sfk13
Sfk13
 
jQuery Mobile Overview - Boston
jQuery Mobile  Overview -  BostonjQuery Mobile  Overview -  Boston
jQuery Mobile Overview - Boston
 
SGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page InterfaceSGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page Interface
 
Building a PWA with Ionic, Angular and Spring Boot - Jfokus 2017
Building a PWA with Ionic, Angular and Spring Boot - Jfokus 2017Building a PWA with Ionic, Angular and Spring Boot - Jfokus 2017
Building a PWA with Ionic, Angular and Spring Boot - Jfokus 2017
 
Sxsw2013
Sxsw2013Sxsw2013
Sxsw2013
 
React native - What, Why, How?
React native - What, Why, How?React native - What, Why, How?
React native - What, Why, How?
 
jQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchAppsjQuery Conference Boston 2011 CouchApps
jQuery Conference Boston 2011 CouchApps
 
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkBuilding a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
 
Interoperability of components built with different frameworks
Interoperability of components built with different frameworksInteroperability of components built with different frameworks
Interoperability of components built with different frameworks
 
Upstate CSCI 450 jQuery
Upstate CSCI 450 jQueryUpstate CSCI 450 jQuery
Upstate CSCI 450 jQuery
 
Developing java Web Applications Using Google Apps RJUG 2011
Developing java Web Applications Using Google Apps RJUG 2011Developing java Web Applications Using Google Apps RJUG 2011
Developing java Web Applications Using Google Apps RJUG 2011
 
Whats New In Spring 3.0 ?
Whats New In Spring 3.0 ?Whats New In Spring 3.0 ?
Whats New In Spring 3.0 ?
 

Viewers also liked

Matthew 8 commentary
Matthew 8 commentaryMatthew 8 commentary
Matthew 8 commentary
GLENN PEASE
 
(PEWET Workshop) (Keynote) Vincenzo De Florio - “Fractally-organized Connecti...
(PEWET Workshop) (Keynote) Vincenzo De Florio - “Fractally-organized Connecti...(PEWET Workshop) (Keynote) Vincenzo De Florio - “Fractally-organized Connecti...
(PEWET Workshop) (Keynote) Vincenzo De Florio - “Fractally-organized Connecti...
icwe2015
 
Emotional intelligence
Emotional intelligenceEmotional intelligence
Emotional intelligence
Abhay kimar
 
Antiviral treatment policy
Antiviral treatment policyAntiviral treatment policy
Interim partners nhs confederation poll results
Interim partners nhs confederation poll resultsInterim partners nhs confederation poll results
Interim partners nhs confederation poll results
Maria Duvidzon
 
North East HR Update 2014
North East HR Update 2014North East HR Update 2014
North East HR Update 2014
Nigel Wright Group
 
Benefit beat July 2015
Benefit beat July 2015Benefit beat July 2015
Benefit beat July 2015
Daniel Michels
 

Viewers also liked (9)

Matthew 8 commentary
Matthew 8 commentaryMatthew 8 commentary
Matthew 8 commentary
 
(PEWET Workshop) (Keynote) Vincenzo De Florio - “Fractally-organized Connecti...
(PEWET Workshop) (Keynote) Vincenzo De Florio - “Fractally-organized Connecti...(PEWET Workshop) (Keynote) Vincenzo De Florio - “Fractally-organized Connecti...
(PEWET Workshop) (Keynote) Vincenzo De Florio - “Fractally-organized Connecti...
 
Emotional intelligence
Emotional intelligenceEmotional intelligence
Emotional intelligence
 
revista digital
revista digitalrevista digital
revista digital
 
Antiviral treatment policy
Antiviral treatment policyAntiviral treatment policy
Antiviral treatment policy
 
Interim partners nhs confederation poll results
Interim partners nhs confederation poll resultsInterim partners nhs confederation poll results
Interim partners nhs confederation poll results
 
North East HR Update 2014
North East HR Update 2014North East HR Update 2014
North East HR Update 2014
 
Tinyfox сайт
Tinyfox сайтTinyfox сайт
Tinyfox сайт
 
Benefit beat July 2015
Benefit beat July 2015Benefit beat July 2015
Benefit beat July 2015
 

Similar to React mini lecture

Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Matt Raible
 
React, Flux and a little bit of Redux
React, Flux and a little bit of ReduxReact, Flux and a little bit of Redux
React, Flux and a little bit of Redux
Ny Fanilo Andrianjafy, B.Eng.
 
Heuristics to scale your framework
Heuristics to scale your frameworkHeuristics to scale your framework
Heuristics to scale your framework
vodQA
 
ProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applicationsProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applications
Binary Studio
 
Why Use Rails by Dr Nic
Why Use Rails by  Dr NicWhy Use Rails by  Dr Nic
Why Use Rails by Dr Nic
Dr Nic Williams
 
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Dakiry
 
JS Class 2016
JS Class 2016JS Class 2016
JS Class 2016
Yves-Emmanuel Jutard
 
Associations & JavaScript
Associations & JavaScriptAssociations & JavaScript
Associations & JavaScript
Joost Elfering
 
JS class slides (2016)
JS class slides (2016)JS class slides (2016)
JS class slides (2016)
Yves-Emmanuel Jutard
 
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QAFest
 
Ajax basics
Ajax basicsAjax basics
Ajax basics
amanrahulraj
 
Welcome to React.pptx
Welcome to React.pptxWelcome to React.pptx
Welcome to React.pptx
PraveenKumar680401
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Matt Raible
 
Refactor Large apps with Backbone
Refactor Large apps with BackboneRefactor Large apps with Backbone
Refactor Large apps with Backbone
devObjective
 
Refactor Large applications with Backbone
Refactor Large applications with BackboneRefactor Large applications with Backbone
Refactor Large applications with Backbone
ColdFusionConference
 
Refactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.jsRefactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.js
Stacy London
 
An introduction-to-ruby-on-rails
An introduction-to-ruby-on-railsAn introduction-to-ruby-on-rails
An introduction-to-ruby-on-rails
vinicorp
 
An Introduction to Ruby on Rails 20100506
An Introduction to Ruby on Rails 20100506An Introduction to Ruby on Rails 20100506
An Introduction to Ruby on Rails 20100506
Vu Hung Nguyen
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3
Zachary Klein
 
JavaScript-Core
JavaScript-CoreJavaScript-Core
JavaScript-Core
tutorialsruby
 

Similar to React mini lecture (20)

Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
 
React, Flux and a little bit of Redux
React, Flux and a little bit of ReduxReact, Flux and a little bit of Redux
React, Flux and a little bit of Redux
 
Heuristics to scale your framework
Heuristics to scale your frameworkHeuristics to scale your framework
Heuristics to scale your framework
 
ProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applicationsProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applications
 
Why Use Rails by Dr Nic
Why Use Rails by  Dr NicWhy Use Rails by  Dr Nic
Why Use Rails by Dr Nic
 
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
 
JS Class 2016
JS Class 2016JS Class 2016
JS Class 2016
 
Associations & JavaScript
Associations & JavaScriptAssociations & JavaScript
Associations & JavaScript
 
JS class slides (2016)
JS class slides (2016)JS class slides (2016)
JS class slides (2016)
 
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
 
Ajax basics
Ajax basicsAjax basics
Ajax basics
 
Welcome to React.pptx
Welcome to React.pptxWelcome to React.pptx
Welcome to React.pptx
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
 
Refactor Large apps with Backbone
Refactor Large apps with BackboneRefactor Large apps with Backbone
Refactor Large apps with Backbone
 
Refactor Large applications with Backbone
Refactor Large applications with BackboneRefactor Large applications with Backbone
Refactor Large applications with Backbone
 
Refactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.jsRefactoring Large Web Applications with Backbone.js
Refactoring Large Web Applications with Backbone.js
 
An introduction-to-ruby-on-rails
An introduction-to-ruby-on-railsAn introduction-to-ruby-on-rails
An introduction-to-ruby-on-rails
 
An Introduction to Ruby on Rails 20100506
An Introduction to Ruby on Rails 20100506An Introduction to Ruby on Rails 20100506
An Introduction to Ruby on Rails 20100506
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3
 
JavaScript-Core
JavaScript-CoreJavaScript-Core
JavaScript-Core
 

Recently uploaded

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 

Recently uploaded (20)

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 

React mini lecture

  • 1. July 5, 2015 Ilia Lobsanov A gentle introduction
  • 2. Objectives • Build a user interface by diving into code • Learn the basics of React
  • 3. What’s React? • A javascript library for building user interfaces • Great for single-page applications • Developed at Facebook/Instagram, open-sourced in 2013 • Used by Khan Academy, New York Times, Airbnb
  • 4. The Basics 1 var HelloMessage = React.createClass({ 2 render: function() { 3 return <div>Hello {this.props.name}</div>; 4 } 5 }); 6 7 React.render(<HelloMessage name="John" />, mountNode);
  • 5. The Basics 1 var HelloMessage = React.createClass({ 2 render: function() { 3 return <div>Hello {this.props.name}</div>; 4 } 5 }); 6 7 React.render(<HelloMessage name="John" />, mountNode);
  • 8. 1 var Friend = React.createClass({ 2 render: function() { 3 return ( 4 <div className="friend"> 5 <h2 className="name"> 6 {this.props.name} 7 </h2> 8 </div> 9 ); 10 } 11 });
  • 9. 1 var FriendList = React.createClass({ 2 render: function() { 3 var friendNodes = this.props.data.map(function(friend) { 4 return ( 5 <Friend name={friend.name}> 6 </Friend> 7 ); 8 }); 9 10 return ( 11 <div className="friendList"> 12 {friendNodes} 13 </div> 14 ); 15 } 16 });
  • 10. 1 var FriendForm = React.createClass({ 2 handleChange: function(e) { 3 e.preventDefault(); 4 var name = React.findDOMNode(this.refs.name).value.trim(); 5 6 this.props.onFriendChange({ 7 name: name 8 }); 9 }, 10 11 render: function() { 12 return ( 13 <form className="friendForm"> 14 Name: 15 <input type="text" ref="name" onChange={this.handleChange}/> 16 </form> 17 ); 18 } 19 });
  • 11. 1 var FriendBox = React.createClass({ 2 loadFriendsFromServer: function(formData) { 3 $.get(this.props.url, formData, function(data) { 4 this.setState({ data: data.friends }); 5 }.bind(this)); 6 }, 7 8 render: function() { 9 return ( 10 <div className="friendBox"> 11 <h1>Friend Finder</h1> 12 <FriendForm onFriendChange={this.loadFriendsFromServer} /> 13 <FriendList data={this.state.data} /> 14 </div> 15 ); 16 } 17 });
  • 12. 1 var FriendBox = React.createClass({ 2 loadFriendsFromServer: function(formData) { 3 $.get(this.props.url, formData, function(data) { 4 this.setState({ data: data.friends }); 5 }.bind(this)); 6 }, 7 8 render: function() { 9 return ( 10 <div className="friendBox"> 11 <h1>Friend Finder</h1> 12 <FriendForm onFriendChange={this.loadFriendsFromServer} /> 13 <FriendList data={this.state.data} /> 14 </div> 15 ); 16 } 17 });
  • 13. More Info • The app: http://friend-finder-react.herokuapp.com/ • Source Code: https://github.com/nurey/friend-finder

Editor's Notes

  1. Here we are printing “Hello John” to the screen.
  2. The “name” attribute of the “HelloMessage” element is set to “John”. We are referring to “John” via “this.props.name”.
  3. We will build a friend finder. On the left we have the initial view: a list of friends. On the right we typed the letter “j” and got a list of friends whose names start with that letter. Does this remind you of something you’ve seen online? Facebook list of friends?
  4. Let’s break down the interface into components.
  5. Let’s start with the most primitive element of the interface: the Friend. Here we are defining a React component for a Friend. The class has one function, render, which returns the html. On line 6, we are inserting the name property which we will be passing into the component.
  6. Now we are building a list of friends. We create a new React component representing a list of friends. At line 3, we transform a list of friend objects into a list of Friend components, which we are calling `friendNodes`. On line 5 we can see that each friend object has a name property which we pass into the Friend component as a property. At line 10, we return a div containing the list of Friend components.
  7. Now let’s implement the html form with the text input. Starting at line 12, we build the the form and the text input. At line 15, notice the onChange attribute. We set to this attribute to a function in the same FriendForm component. Line 2 starts the definition of the handleChange function. At line 4, we grab whatever the user typed in the Name field. We trim any extraneous whitespace with the trim function. Notice how we grabbed the name field by the ref attribute. At line 6, we send the name to another function which we will see shortly.
  8. Here’s the final component that composes together the previous components. You can see on line 12 where we set the onFriendChange property to a function that handles loading the friends from the server.
  9. The function to load the friends is an ajax request that assigns the data received from the server to the component state. The FriendList component relies on the same component state to draw the list of friends.