More Related Content
Similar to React Webinar With CodePolitan (20)
More from Riza Fahmi (20)
React Webinar With CodePolitan
- 2. AGENDA
▸ WHAT IS REACT
▸ WHO IS USING REACT
▸ CORE CONCEPT OF REACT
▸ WHY REACT
▸ HOW TO USE REACT
- 3. ABOUT ME
HI, I’M RIZA
CURRICULUM DIRECTOR, CO-FOUNDER
“HACKTIV8 ADA UNTUK MENCIPTAKAN
DEVELOPER HANDAL YANG BISA BERJAYA DI
NEGARA SENDIRI"
- 4. ABOUT ME
HI, I’M RIZA
riza@hacktiv8.com
facebook.com/rizafahmi
github.com/rizafahmi
medium.com/@rizafahmi22
@rizafahmi22
appscoast.id
- 6. WHAT
REACT IS A JAVASCRIPT LIBRARY FOR BUILDING
USER INTERFACES. IT’S V OF MVC
- 24. 2. Get template
as string
3. Append data
to template string
1. Request
4. Send template to client as HTML
Controller View/Template
- 34. $ npm install -g create-react-app
$ create-react-app leaderboard
- 35. OUR FIRST REACT COMPONENT
1 var CommentBox = React.createClass({
2 render: function() {
3 return (
4 <div className="commentBox">
5 Hello, world! I am a CommentBox.
6
</div>
7 );
8 }
9 });
10
11 ReactDOM.render(
12 <CommentBox
/>,
13 document.getElementById('content')
14 );
- 36. OUR FIRST REACT COMPONENT IN ES6 FLAVOR
1 class CommentBox extends React.Component {
2 render() {
3 return (
4 <div className="commentBox">
5 Hello, world! I am a CommentBox.
6 </div>
7 );
8 }
9 };
10
11 ReactDOM.render(
12 <CommentBox />,
13 document.getElementById('content')
14 );
- 37. 1 // Props
2
3 <Hello say=“Halo Bandung!” />
4
5 console.log(this.props.say) // => “Halo Bandung!”
6
7
8 // States
9 class Hello extends React.Component {
10 constructor() {
11 super()
12 this.state = {say: “Halo Bogor!”}
13 }
14 render () {
15 <Hello say={this.state.say} />
16 }
17 }
‘MODELS’ IN REACT
- 43. BEFORE WE SAY GOODBYE
IF YOU LIKE OUR WEBINAR…
http://bit.ly/hacktiv8-webinar