More Inside the Classes
React
Shan-Hung Wu & DataLab
CS, NTHU
Separation of Concerns
?
?
?
?
?
HTML: noun
CSS: adjective
JS: verb
Applies well to static pages
But for dynamic content, JS usually ¡°crosses
the line¡±
el.textContent = '...';
2
Modern Frontend Framework
? Write JS in HTML
? Write HTML in JS
3
? Component-based
? Debug-friendly
¨C Syntax errors fails at compile time
¨C Declarative properties make runtime debugging
easy
? Extends to mobile landscape (React Native)
4
$ npm install --save react react-dom
$ npm install --save-dev babel-preset-react
// in webpack.config.js
entry: {
index: './index.jsx',
vendor: ['react', 'react-dom']
}
module: {
rules: [{
test: /\.(js|jsx)$/,
exclude: [/node_modules/],
use: [{
loader: 'babel-loader',
options: {
presets: [
['es2015', {'modules': false}],
'react'
]
}
}]
}], ...
}
Hello React
? *.jsx are JS files with
HTML embedded
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
Related searches
- are online classes more effective
- does the citation go inside the quote
- inside the vice president s residence
- inside the vice president house
- inside the vice president s house
- infection inside the mouth
- pain on the inside of elbow joint
- inside the world s toughest prisons
- inside the cockpit takeoff
- inside the world s worst prisons
- pain on the inside of the knee
- walt disney world hotels inside the park