•Build complex UI without pain
•That’s easy - re-render whole page on change
•React.js will make a diff and apply only changes to
DOM
React? What’s React? Why React?
React elements composition
Nested elements
Nested elements
Nested elements
this.props.children
•SEO - no need phantom.js renderer for SPA
•Increase first load speed
•JS-bindings «on flight»
Server Side Rendering
Server Side Rendering: Node.js
Server Side Rendering: Node.js
https://github.com/artyomtrityak/react-server-render-node
Flux
Flux: one directional data flow
onClick
onSelect
onChange
…
Actions.actionName(params)
!
UserActions.createUser(…)
UserActions.selectGroup(…) 1
2
3
Flux: Who is owner? React is owner
1
2
3
4
Flux: Action -> WebUtils -> Dispatcher
1
2
3
Сервер
Fetch.js
Superagent
jQuery.ajax
EventEmitter
EventEmitter Events
1
2
3
ES6 Store
Immutable.js
http://facebook.github.io/immutable-js
•Immutable state
•One directional data flow
Flux: «умные» и «глупые» компоненты
Smart component
(state)
STORE
ACTIONS