Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[ReactJS How to Workshop] Day 01
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Khánh Trần
September 24, 2016
Programming
1
53
[ReactJS How to Workshop] Day 01
Slide for my workshop about ReactJS at geekup.vn
Khánh Trần
September 24, 2016
Tweet
Share
More Decks by Khánh Trần
See All by Khánh Trần
Docker-Compose workshop
rualatngua
2
230
ReactJS - The Container component pattern
rualatngua
0
62
Seneca workshop
rualatngua
0
140
Other Decks in Programming
See All in Programming
CSC307 Lecture 03
javiergs
PRO
1
490
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
740
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
CSC307 Lecture 07
javiergs
PRO
1
550
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
並行開発のためのコードレビュー
miyukiw
0
280
Raku Raku Notion 20260128
hareyakayuruyaka
0
330
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
Oxlintはいいぞ
yug1224
5
1.3k
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
460
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Believing is Seeing
oripsolob
1
56
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
250
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
210
Accessibility Awareness
sabderemane
0
53
Transcript
ReactJS How to
Today topics • Set-up and Run 1st demo • ES6
Crash course • Project structure & Workflow • Components & JSX Syntax • And Components ... and components
Set-up and Run 1st demo npm install -g create-react-app create-react-app
my-app cd my-app/ npm start Open Demo
ES6 Crash course An JavaScript file is a module... //
file foo.js const COLOR_THEME = 'Ocean'; function sayHello(name) { console.log(`Hello ${name}`); } class Foo { sum(a, b) { return a + b; } } export default Foo; export {COLOR_THEME, sayHello};
ES6 Crash course Export and export default export default Foo;
export {COLOR_THEME, sayHello};
ES6 Crash course Import from a module import Foo, {sayHello,
COLOR_THEME} from './foo'; //don't need .js for import js // or only default class Foo import Foo from './foo'; // or rename to new name import Foo as Bar from './foo'; // or only sayHello function import {sayHello}
ES6 Crash course Arrow Function function sum(a, b) { return
a + b; } const sum = (a, b) => a + b; const arr = [4, 5, 8, 2, 1, 3, 9, 7]; // filter odd number only console.log( arr.filter(number => number % 2 === 0) );
Project Structure & Workflow
Its dead simple to add new component React Color npm
install react-color --save import React from 'react'; import { SketchPicker } from 'react-color'; class Component extends React.Component { render() { return <SketchPicker />; } }
index.js import React from 'react'; import ReactDOM from 'react-dom'; import
App from './App'; ReactDOM.render( <App />, document.getElementById('root') );
packages.json 1. dependencies 2. devDependencies 3. scripts npm install --save
react-color npm install --save-dev chancejs
Render component import React, { Component } from 'react'; import
logo from './logo.svg'; import './App.css'; class App extends Component { render() { return ( <div className="App"> <div className="App-header"> <img src={logo} className="App-logo" alt="logo" /> <h2>Welcome to React</h2> </div> <p className="App-intro"> To get started, edit <code>src/App.js</code> and save to reload. </p> </div> ); } } export default App;
Development Tools 1. Webpack • Handling all assets • Leverage
Import css/sass/image/svg • Post process 2. Babel: translsate ES6 to ES5 3. Npm: npm start and npm build
Let make a Button From Class component... import React from
'react'; class Button extends React.Component { render () { const {text, onClick} = this.props; return ( <button onClick={onClick}>{text}</button> ); } } export default Button;
Let make a Button ... to Function component import React
from 'react'; const Button = ({ text, onClick }) => { <button onClick={onClick}>{text}</button> } export default Button;
Learning Resources • How to develop apps bootstrapped with Create
React App. • Grommet getting start • React JS and why it's awesome • Ecosystem
What next? • Lifecycle methods • Props and State •
Routing • Manage Application State with Mobx • Handle form • Testing with Jest • Styling & Responsive