Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
React+Storybook ことはじめ
Search
Toshihisa Tomatsu
May 27, 2019
Technology
2.6k
8
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React+Storybook ことはじめ
React.js meetup #7 (LT会)の資料です。
https://reactjs-meetup.connpass.com/event/130682/
Toshihisa Tomatsu
May 27, 2019
More Decks by Toshihisa Tomatsu
See All by Toshihisa Tomatsu
"フロントエンドの技術"を移行する技術 / Frontend Migrations
10shi10ma
0
120
Service Workerとは、それを使ってできること / what-is-service-worker
10shi10ma
3
2k
フロントエンドのエコシステム / Frontend Ecosystem
10shi10ma
8
3.4k
Service Workerとブラウザでの通知について
10shi10ma
3
400
意外に知らないnpmと便利なCLI
10shi10ma
8
2.5k
歴史から学ぶ現代のフロントエンド
10shi10ma
17
11k
サイボウズ フロントエンドエキスパートチームとOSSの管理について
10shi10ma
0
1.2k
大規模フロントエンドの技術的負債と向き合う。
10shi10ma
5
6.1k
Google I/O ’19から見る新しいJavaScript
10shi10ma
5
3.2k
Other Decks in Technology
See All in Technology
継続的なAIコスト最適化
bgpat
1
280
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
820
FactoryBotアンチパターン / factory_bot anti-patterns
toshimaru
0
140
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
130
SDDの運用にめげずに向き合った話
sansantech
PRO
1
140
カンファレンスに参加した後の浮遊感とセルフケア
pauli
0
320
おそらく日本で唯一のDevRelインターン生として
husengs7
0
170
AI時代のAPI開発を加速する品質ガードレール / API Quality Guardrails in the AI Era
yokawasa
0
180
Jetson Orin Nanoとk3sとローカルLLMで音声文字起こしシステム作ってみた
y_sera15
0
110
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
170
使いこなすために知っておきたい Azure SRE Agent アンチパターン
torumakabe
2
450
go-sqletch
moznion
0
130
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
320
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
720
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
300
Building Applications with DynamoDB
mza
96
7.2k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Building Adaptive Systems
keathley
44
3.2k
Transcript
1 React+Storybook ͜ͱ͡Ί React.js meetup #7 2019/05/27 @toshi-toma
2 About Me Toshihisa Tomatsu @toshi-toma @toshi__toma
3 ൃදͷഎܠ • ࠷ۙɺ"UPNJD DesignͷຊΛಡΈ͡Ίͯ ͦΕΛࢼͨ͢Ίʹίϯϙʔωϯτ(React+styled- componets+TypeScript)։ൃʹStorybookΛͬͯΈ·ͨ͠ • ReactͷϓϩδΣΫτͰStorybookΛ͏࣌ͷΛ͠·͢ •
खݩͰ༡ΜͩఔͳͷͰɺӡ༻͍ͯ͘͠ݟͳ͍Ͱ͢
4 • UIίϯϙʔωϯτΛΞϓϦέʔγϣϯͱಠཱͨ͠ڥͰ։ൃͰ͖ Δπʔϧ • `build-storybook`ίϚϯυͰίϯϙʔωϯτϦετͷ੩తαΠ τΛੜͰ͖ΔͷͰUIίϯϙʔωϯτΧλϩάͱͯ͠ • ελΠϧΨΠυίϯϙʔωϯτͷ༷ •
։ൃͨ͠ίϯϙʔωϯτͷڍಈΛ֬ೝ • ίϯϙʔωϯτͷςετ https://github.com/storybooks/storybook
5 Storybook React Official https://storybooks-official.netlify.com
6 React + Storybook • ಋೖܗੜίϚϯυΛ࣮ߦ͢Δ͚ͩ QBDLBHFKTPOඞཁ • npx -p
@storybook/cli sb init --type react stories/ |- index.stories.js .storybook/ |- addons.js |- config.js package.json node_modules package-lock.json package.json "scripts": { + "storybook": "start-storybook -p 6006", + "build-storybook": "build-storybook" }, "dependencies": { + "@storybook/addon-actions": "^5.0.11", + "@storybook/addon-links": "^5.0.11", + "@storybook/addons": "^5.0.11", + "@storybook/react": "^5.0.11",
7 $ npm run storybook
8 xx.story.js • ͋ͱAYYTUPSZKTAͰ4UPSZCPPLʹදࣔ͢ΔίϯϙʔωϯτΛॻ͍ ͍͚ͯͩ͘
9 With TypeScript • `$ npm i -D typescript ts-loader`
• StorybookͷϏϧυϓϩηεͰTSXΛॲཧͰ͖ΔΑ͏ʹ `.storybook/webpack.config.js`Λ࡞
10 With TypeScript • ࠓޙAYYTUPSJFTUTYAʹॻ͍͍ͯ͘ • `.storybook/config`ϑΝΠϧΛฤू • `$ npm
i -D @types/storyboook__react`
11 react-docgen-typescript-loader • TypeScript Reactίϯϙʔωϯτ͔ΒdocgenใΛੜ͢Δͨ Ίͷloader • @storybook/addon-info”ͰίϯϙʔωϯτͷPropsใΛςʔ ϒϧܗࣜͰࣗಈੜ͢Δ࣌ʹ͏ •
`npm install -D react-docgen-typescript-loader` • webpack.config.js `use: [require.resolve('ts-loader'), require.resolve(‘react-docgen-typescript-loader')],` https://github.com/strothj/react-docgen-typescript-loader
12 ಋೖָ͍͢͝ • ϝϯςେมͦ͏͚ͩͲɺಠཱͨ͠ڥͰ6*ίϯϙʔωϯτΛ։ ൃͰ͖ΔͷϝϦοτେ͖ͦ͏ ΤϯδχΞઢ • StoryΛ࡞Δͷ͕େมͳίϯϙʔωϯτͦͦઃܭ͕͓͔͠ ͍ʁ •
࠶ར༻ੑɺదͳίϯϙʔωϯτׂΛߟ͑Δ͍͍͖͔͚ͬʹͳ Δ͔
13 Thanks
14 ࢀߟϦϯΫ • https://github.com/storybooks/storybook • https://www.learnstorybook.com/ • https://storybook.js.org/docs/guides/guide-react/ • https://storybook.js.org/docs/configurations/typescript-
config/