Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ReactJS Awesomeness
Search
Swaroop SM
July 28, 2015
Programming
3
260
ReactJS Awesomeness
A quick introduction to ReactJS
Swaroop SM
July 28, 2015
Tweet
Share
More Decks by Swaroop SM
See All by Swaroop SM
Client-Side Data Modelling and more...
swaroopsm
0
56
Testing JavaScript like a "BOSS"
swaroopsm
0
56
The Truth About Truthy & Falsy
swaroopsm
1
53
Other Decks in Programming
See All in Programming
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
7
2.5k
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
4
1.3k
Open source software: how to live long and go far
gaelvaroquaux
0
620
負債になりにくいCSSをデザイナとつくるには?
fsubal
9
2.3k
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
110
Domain-Driven Transformation
hschwentner
2
1.9k
『品質』という言葉が嫌いな理由
korimu
0
160
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
170
Immutable ActiveRecord
megane42
0
130
Writing documentation can be fun with plugin system
okuramasafumi
0
120
Conform を推す - Advocating for Conform
mizoguchicoji
3
680
Formの複雑さに立ち向かう
bmthd
1
720
Featured
See All Featured
Music & Morning Musume
bryan
46
6.3k
Thoughts on Productivity
jonyablonski
69
4.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Side Projects
sachag
452
42k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.6k
How GitHub (no longer) Works
holman
313
140k
Unsuck your backbone
ammeep
669
57k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
A Philosophy of Restraint
colly
203
16k
Transcript
ReactJS Awesomeness
I don’t want to learn another JS framework.
Well what is it then?
• Born at Facebook. • Lets you build user interfaces.
• Described as the V in MVC. • Building large applications with data that changes over time. • Actively maintained. • https://github.com/facebook/react
I AM NOT CONVINCED
TIME TO GET SERIOUS
What it does not have? • No Router. • No
Controllers. • No Models. • No Templates.
What does it have then? • Components • And Components
• …. And Components
Separation of Concerns • Controller • Remove an item. •
Compl
Separate the Components
Component-Wise Separation • Composable • Reusable • Maintainable • Testable
STILL NO “REACTION?”
React Stuffs • Component • JSX • props • state
• refs • Virtual DOM • Server-Side Rendering
Component • Elements in view. Eg.: Button Widget, Shopping Cart
Widget etc. • `React.createClass({ })` • Must override the render method
None
JSX • A JS syntax extension that looks like XML
• Can be transformed into JS using React
None
props • Immutable • Attributes to a component. • Accessible
through `this.props`
None
state • Mutable • Set using `setState` • Access via
`this.state` • Triggers a render automatically when a state changes
None
refs • Lets you access references to individual components •
Manipulate the DOM • Use `this.refs`
None
Virtual DOM • Virtual Representation of DOM • Can keep
track of what has changes in the DOM • Render only the changed parts based on a diffing algorithm • VERY FAST!!!
Server-Side Rendering • Construct React components as an HTML on
the server-side and render it. • SEO for Free :)
Integrating with Rails • https://github.com/reactjs/react-rails • react_component(<Button />, props={}, html_options={})
#jally Thank You