pragmatic introduction to react — maayan glikser

15
PRAGMATIC INTRODUCTION TO REACT Maayan Glikser

Upload: 500tech

Post on 21-Jan-2017

301 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Pragmatic Introduction to React — Maayan Glikser

PRAGMATIC INTRODUCTION TO REACT

Maayan Glikser

Page 2: Pragmatic Introduction to React — Maayan Glikser

Maayan Glikser

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

Front End Developer @ 500Tech

Page 3: Pragmatic Introduction to React — Maayan Glikser

ReactJS

Page 4: Pragmatic Introduction to React — Maayan Glikser

Component Driven Development

Page 5: Pragmatic Introduction to React — Maayan Glikser

Thinking in components

Page 6: Pragmatic Introduction to React — Maayan Glikser

Thinking in components

Page 7: Pragmatic Introduction to React — Maayan Glikser

JSX

`

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

Page 8: Pragmatic Introduction to React — Maayan Glikser

Without JSX

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

Page 9: Pragmatic Introduction to React — Maayan Glikser

`

Basic Component

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

Page 10: Pragmatic Introduction to React — Maayan Glikser

PROPS & STATE

Page 11: Pragmatic Introduction to React — Maayan Glikser

Lifecycle methods

Mount componentWillMount → Angular PreLink

componentDidMount → Angular PostLink

Update componentWillUpdate

componentDidUpdate

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

Page 12: Pragmatic Introduction to React — Maayan Glikser

DEMO

Page 13: Pragmatic Introduction to React — Maayan Glikser

Flux

Page 14: Pragmatic Introduction to React — Maayan Glikser

Flux

Flummox Fluxible Marty.js NuclearJS

Redux Lux.js Reflux Alt.js

Page 15: Pragmatic Introduction to React — Maayan Glikser

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

Maayan [email protected]