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
Reactハンズオン 01 入門編 コード部分抜粋 / React Handson 01 co...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shunsuke Watanabe
October 06, 2018
Programming
600
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Reactハンズオン 01 入門編 コード部分抜粋 / React Handson 01 components (excerpt)
改訂2版
Shunsuke Watanabe
October 06, 2018
More Decks by Shunsuke Watanabe
See All by Shunsuke Watanabe
いますぐ {id: number;} をやめろ
craftgear
1
370
forループを越えて / beyond for loop
craftgear
0
580
Reactハンズオン 02 redux編 コード部分抜粋 / React Handson 02 redux (excerpt)
craftgear
0
590
Reactハンズオン 01 入門編 コード部分抜粋 / React Handson 01 components (excerpt)
craftgear
0
720
Reactで作るDrupalサイト
craftgear
0
500
大阪Node学園 七時限目 「ゼロからはじめるnode.js」
craftgear
1
430
大阪Node学園 六時限目 「generator小咄」
craftgear
1
340
大阪Node学園四時限目 "This crazy testless world"
craftgear
1
350
Other Decks in Programming
See All in Programming
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
A2UI という光を覗いてみる
satohjohn
1
120
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
17
6.3k
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.6k
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
3.5k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
3Dシーンの圧縮
fadis
1
680
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
200
OSもどきOS
arkw
0
470
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
620
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.9k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
160
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Building Applications with DynamoDB
mza
96
7.1k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
160
Six Lessons from altMBA
skipperchong
29
4.3k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Code Reviewing Like a Champion
maltzj
528
40k
First, design no harm
axbom
PRO
2
1.2k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
720
AI: The stuff that nobody shows you
jnunemaker
PRO
8
700
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
200
Transcript
1 // src/components/HelloWorld.js 2 3 import React from 'react'; 4
5 export default () => { 6 return <h1>Hello World</h1> 7 } 1 // src/App.js 2 3 import React, { Component } from 'react'; 4 import logo from './logo.svg'; 5 import './App.css'; 6 import HelloWorld from './components/HelloWorld'; 7 8 class App extends Component { 9 render() { 10 return ( 11 <div className="App"> 12 <HelloWorld /> 13 <header className="App-header"> 14 <img src={logo} className="App-logo" alt="logo" /> 15 <h1 className="App-title">Welcome to React</h1> 16 </header> 17 <p className="App-intro"> 1
1 // src/App.js 2 …… 8 class App extends Component
{ 9 render() { 10 return ( 11 <div className="App"> 12 <HelloWorld greeting="͓Α͏" /> …… 20 </div> 21 ); 22 } 23 } 24 25 export default App; 1 // src/components/HelloWorld.js 2 3 import React from 'react'; 4 5 export default props => { 6 return <h1>{props.greeting} World</h1>; 7 }; 2
1 // src/components/HelloWorld.js 2 3 import React from 'react'; 4
5 export default ({ greeting }) => { 6 return <h1>{greeting} World</h1>; 7 }; 3
1 // src/components/HelloWorld.js 2 3 import React from 'react'; 4
5 export default ({ greeting = 'Bonjour' }) => { 6 return <h1>{greeting} World</h1>; 7 } 1 // src/App.js 2 …… 8 class App extends Component { 9 render() { 10 return ( 11 <div className="App"> 12 <HelloWorld /> …… 20 </div> 21 ); 22 } 23 } 24 25 export default App; 4 ←greetingΛফ͢
1 // src/components/HelloWorld.js 2 3 import React from 'react'; 4
5 const styles = { 6 h1: { 7 color: 'gold', 8 backgroundColor: 'black' 9 } 10 } 11 12 export default ({ greeting = 'Bonjour', to }) => { 13 return ( 14 <h1 style={styles.h1}> 15 {greeting} {to} 16 </h1> 17 ); 18 }; 5
1 // src/App.js …… 8 class App extends Component {
9 constructor(props) { 10 super(props); 11 this.state = { 12 greeting: 'Hello', 13 to: 'World', 14 }; 15 this.updateGreeting = this.updateGreeting.bind(this); 16 } 17 18 updateGreeting() { 19 this.setState({ greeting: '͜Μʹͪ' }); 20 } 21 22 render() { 23 return ( 24 <div className="App"> 25 <HelloWorld greeting={this.state.greeting} to={this.state.to} /> 26 <button onClick={this.updateGreeting}>͍͋ͭ͞มߋ</button> 27 <header className="App-header"> 28 <img src={logo} className="App-logo" alt="logo" /> 6