-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreza.html
216 lines (155 loc) · 4.88 KB
/
preza.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE html>
<html>
<head>
<title>Pizasessie React & Redux</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body { font-family: 'Droid Serif'; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
</style>
</head>
<body>
<textarea id="source">
class: center, middle
# Pizzasessie React & Redux
en een beetje Firebase
-- Jeroen Peeters --
---
# Topics
1. NPM
2. React
3. Redux
4. Firebase
5. Mobile app
---
# NPM
- NPM is the official package manager for Node.js
- NPM runs on the command line and manages dependencies for an application
- It also allows users to install Node.js applications that are available on the NPM registry
```json
{
"name": "my-project",
"version": "0.0.1",
"description": "My Awesome Node Project",
"main": "index.js",
"author": "Jeroen Peeters",
"dependencies": {
"react": "0.4.2"
}
}
```
---
# React
- A JavaScript library for building user interfaces
---
## Virtual DOM
- Replica of the Browser DOM
- React redraws the entire screen on change
- React calculates the minimum amount of changes required
---
## Virtual DOM

---
## Most important API methods
- React.createClass();
- React.render();
---
## React.createClass
- Creates a component class, given a specification
- A component implements a render method which returns a single child
- That child may have an arbitrarily deep child structure
- They are convenience wrappers that construct backing instances (via new) for you
```js
var React = require('react');
var Hello = React.createClass({
render: function () {...}
});
module.exports = Hello;
```
---
### render()
- Required
- Returns a single child component that is either a virtual representation of a native DOM component or composite component
---
### render()
- Should be pure
- Should not modify component state
- Should return the same result each time it's invoked
- Should not read from or write to the DOM
- Work should be performed in other lifecycle methods
---
## React.render()
- Renders a ReactElement into the DOM of the supplied container
- Returns a reference to the component
- Replaces the contents of the container node you pass in
```js
React.render(<Hello friend="WoooHooo"/>, document.getElementById('app'));
```
---
## JSX
- JavaScript syntax extension that looks similar to XML
- Compiles to actual JavaScript
---
### Plain JS
```js
render : function () {
return (
React.createElement("div", {className: "ui message"},
React.createElement("div", {className: "ui huge header"}, this.state.greeting),
React.createElement("div", {className: "ui large header"}, this.props.friend)
)
);
}
```
---
### JSX
```js
render : function () {
return (
<div className="ui message">
<div className="ui huge header">{this.state.greeting}</div>
<div className="ui large header">{this.props.friend}</div>
</div>
);
}
```
---
# Redux
- Redux is a predictable state container for JavaScript apps
- Store
- Actions
- Reducer
---
## Basic Principle
- (previousState, action) -> newState
---
## Advanced Principles

---
# Firebase
- Real time database
- By Google
- Serverless
- Push changes
---
# Acknowledgements
This presentation makes extensive use of the resources listed below and should be
considered a modest subset of all the information available in the linked resources.
- https://github.com/objectpartners/react-redux-workshop
- https://www.slideshare.net/nikgraf/react-redux-introduction
- https://btholt.github.io/complete-intro-to-react/
</textarea>
<script src="https://remarkjs.com/downloads/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create();
</script>
</body>
</html>