-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathextra
373 lines (286 loc) · 6.45 KB
/
extra
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
https://code.visualstudio.com/download (install)
https://nodejs.org/en/ (install)
https://github.com/ (create account)
https://github.com/Aakashdeveloper (follow)
https://git-scm.com/downloads (install)
https://www.postman.com/ (install)
//extension to chrome
https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh
//Extensions to vscode
> TabNine
> vscode-icons
> git history
> git Lens
> spellCheck
> eslint
> https://github.com/Aakashdeveloper/feb_react_mrng8_22
html
css
bootstrap 3,4,5
Npm
React = 3
Mock API
json-server
React_hooks -1
React-JWT(Login Logout)-2
Github
Deployment
-> MERN
-> Aws
-> heroku
-> Docker
-> Nginx
-> Netlify
HOC
React-GraphQL - 1
Basic React Native- 1
React-Redux - 1
React-Redux - 1
React-PWA - 1
Testing Jest Enzime
///////Walkthrough///////
React-Saga -1
React-with-typescript-1
--------NOT Backend--------------
API
GraphQL
Login/Logout
////////////////
React> React is a frontend lib/framework which
help to build single page application
using component based structure
open source
186863
///////Json////
way to represent data
[
{
"name":"John",
"class":"UI",
"city":"Paris"
},
{
"name":"Amit",
"class":"React",
"city":"Mumbai"
}
]
////package.json///////
> Entry Point to the app
> First file in the app
> all the packages
> command start,build,test
> meta data (name,description,version)
////Step to generate package.json///////
**NodeJs must be install in system
> go inside the folder using terminal/cmd
> npm init
> answer all questions
> type "yes"
////Step to install packages///////
> go inside the folder using terminal/cmd
> npm i packagename
/////setup react in system/////
> go inside the folder using terminal/cmd
> npx create-react-app appname
////////////////////////////////
# Window
>>One Time in new system
> open the cmd as administrator
> npm i -g create-react-app
>>Next All Time you need new app
> go inside the folder using cmd
> create-react-app appname
# Mac/Linux
>>One Time in new system
> open terminal
> sudo npm i -g create-react-app
>>Next All Time you need new app
> go inside the folder using terminal
> create-react-app appname
////Step to run react app///////
> go inside the folder using terminal/cmd
> npm start
react > react is the main library
react-script > react script help to run the application
react-dom > help to render the content
//es5 > ecmaScript5
function add(a,b){
return a+b
}
//es6 > ecmaScript6
const add = (a,b) => { return a+b}
function add(a,b){
return a,b
}
add(1,2)
2
hookscomponent
//////////////////
head
>>> all the linking with css,javascript
>>> contains title of the page
body
>>> All the thing which is visible to the user
inline Element
> that always in same line
> take only space which is required
> span a img
block level
> that always in new line
> take space of whole width
> p div h1-h6
https://raw.githubusercontent.com/Aakashdeveloper/Aakashdeveloper/master/README.md
////////////////
css
////////////////
inline
StyleTag
StyleSheet
inline > StyleTag > StyleSheet
div
inline
{
color:red,
font-size:30px
}
StyleTag
{
color:green,
text-align:center;
border:none
}
StyleSheet
{
font-size:40px;
text-align:right;
border-radius:50%
}
{
color:red;
font-size:30px;
text-align:center;
border:none;
border-radius:50%
}
////////////////
TagName > a, p, div, img
className(.) > to target group of Element with same property
Id(#) > to target something unique
position in css
////// 12 gird ////////////
//bs3
xs > 768px,
sm < 768px;
md < 992px;
lg < 1200px
//
//////
class
> Logical Component
> calling api, write logic,display
> can maintain state
functional
> Dumb Component
> display purpose
> cannot maintain state
////
State
> State act like local variable
> Every Component can have its own state
> State can be accesible in same component or nested
> We can update the value of state(mutable)
Props
> Props help to transfer the data
> Data can be transfer in between nested components
> We cannot update value of props (immutable)
// javascript
maps
filter
indexof
var a = [4,7,3,8]
a.map((data) => {return data*2})
[8, 14, 6, 16]
var a = [4,7,3,8]
a.map((data) => {return `<p>${data}</p>`})
['<p>4</p>', '<p>7</p>', '<p>3</p>', '<p>8</p>']
//es5
var age = 10
var out = My age is '+a;
"My age is 10"
//es6
let age = 10
let out = `My age is ${a}`
out
'My age is 10'
var a = [4,7,3,8];
for(i=0;i<a.length;i++){
if(name =="a"){
a[i]= name
}
}
var a = [
{
"name":"John",
"city":"Delhi"
},
{
"name":"Ankit",
"city":"Newyork"
}
];
name == "Ankit"
a[1].name = "Ankit"
a.map((data) => {
if(data.name == "Ankit"){
a.splice()
}
return `<p>${data}</p>`})
var a = [5,7,9,3,6,2,8]
a.filter((data) => { return data<5})
var a = [5,7,9,3,6,2,8]
a.filter((data) => { return data>5})
(4) [7, 9, 6, 8]
var city = ['Delhi', 'Mumbai', 'London', 'Helsinki', 'Venice', 'Amsterdam']
city.indexOf('Delhi')
0
city.indexOf('Venice')
4
city.indexOf('Pune')
-1
city.indexOf('Boston')
-1
parent => child (props)
child => Parent (props with function)
parent (define function)
child (call function)
function add(a,b){
return a+b
}
add(1,2)
3
npm i react-router-dom@5.3.0
///params (/)
> it is compulsory to define the params
> mainly use for single data
///queryParams (?)
> no need to define
> use to pass more than one record
/// default props under routing
> history >> use for redirection
> location >> use for query params
> match >> use for params
(get) cityname > https://zomatoajulypi.herokuapp.com/location
(get) restwrtcity > https://zomatoajulypi.herokuapp.com/restaurant?stateId=1
(get) quickSearch> https://zomatoajulypi.herokuapp.com/quicksearch
(get) onbasisofMeal > https://zomatoajulypi.herokuapp.com/restaurant?mealtype_id=
(get) cuisinefilter > https://zomatoajulypi.herokuapp.com/filter/4?cuisine=1
(get) costfilter > https://zomatoajulypi.herokuapp.com/filter/1?hcost=1000&lcost=500
(get) restdetails > http://zomatoajulypi.herokuapp.com/details/1
(get) menu > https://zomatoajulypi.herokuapp.com/menu/1
(post) orderspage > http://zomatoajulypi.herokuapp.com/menuItem
body [1,4,5]
(post)placeOrder >
(get) allorder>
(get) restaurants> https://zomatoajulypi.herokuapp.com/restaurants
https://developerpayment.herokuapp.com/paynow