pragmatic introduction to react

15
PRAGMATIC INTRODUCTION TO REACT Maayan Glikser

Upload: maayan-glikser

Post on 23-Jan-2018

312 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Pragmatic introduction to react

PRAGMATIC INTRODUCTION TO REACT

Maayan Glikser

Page 2: Pragmatic introduction to react

Maayan Glikser

- Github addict - Hardcore metal fan - Converted from dogs to cats

Front End Developer @ 500Tech

Page 3: Pragmatic introduction to react

ReactJS

Page 4: Pragmatic introduction to react

Component Driven Development

Page 5: Pragmatic introduction to react

Thinking in components

Page 6: Pragmatic introduction to react

Thinking in components

Page 7: Pragmatic introduction to react

JSX

`

let message = ( <div className="hello" onClick={ someFunc }> <span>Hello World</span> </div>);

Page 8: Pragmatic introduction to react

Without JSX

`let message = React.DOM.div({ className: 'hello', onClick: someFunc },[ React.DOM.span(null, ['Hello World']) ]);

Page 9: Pragmatic introduction to react

`

Basic Component

React.createClass({ render() { return <span>Hello World</span>; } });

Page 10: Pragmatic introduction to react

PROPS & STATE

Page 11: Pragmatic introduction to react

Lifecycle methods

Mount componentWillMount → Angular PreLink

componentDidMount → Angular PostLink

Update componentWillUpdate

componentDidUpdate

Unmount componentWillUnmount → $scope.$on('destroy')

Page 12: Pragmatic introduction to react

DEMO

Page 13: Pragmatic introduction to react

Flux

Page 14: Pragmatic introduction to react

Flux

Flummox Fluxible Marty.js NuclearJS

Redux Lux.js Reflux Alt.js

Page 15: Pragmatic introduction to react

Read our blog:http://blog.500tech.com

Maayan [email protected]