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
Next.js & ElectronでTodoアプリを作る
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
yuki21
October 02, 2020
Programming
750
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Next.js & ElectronでTodoアプリを作る
5分間社内LT資料
yuki21
October 02, 2020
More Decks by yuki21
See All by yuki21
労務ドメインを快適に開発する方法 / How to Comfortably Develop in the Labor Domain
yuki21
1
500
GitHubのコマンドパレット使ってますか?
yuki21
0
1.7k
キャッシュを利用してRailsアプリの処理を高速化する
yuki21
0
130
gRPCを完璧に理解する
yuki21
0
59
RSpec -基本の基-
yuki21
0
63
Committeeを導入してみた
yuki21
0
170
マイクロサービスとモノリスとKBR
yuki21
0
61
ActiveModelSerializersについて
yuki21
0
49
脆弱性について
yuki21
0
180
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
380
iOSDC2026登壇資料.pdf
riofujimon
0
200
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
150
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
290
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
460
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
170
setup-vp GitLab対応の裏側
naokihaba
0
140
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
130
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.7k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
750
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
110
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Odyssey Design
rkendrick25
PRO
2
850
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
620
Building Adaptive Systems
keathley
44
3.2k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
900
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
RailsConf 2023
tenderlove
30
1.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Rails Girls Zürich Keynote
gr2m
96
14k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Transcript
Next.js & ElectronでTodoアプリを作る Kobayashi Yuta
Electronとは HTML CSS JavaScript等のWeb技術を使⽤して、 クロスプラットフォームのデスクトップアプリを構築することができる オープンソースフレームワークです。
プロジェクトを作成・ビルド実⾏ $ npx create-next-app --example with-electron-typescript todo-app $ cd todo-app
$ npm run build $ npm run start yarnが⼊ってなかったら⼊れておきます $ npm install -g yarn buildで作成されるファイルをgitの管理外にするために.gitignoreに追加します。 # .gitignore main dist renderer/out renderer/.next
None
画⾯を追加する 通常のNext.jsで新しいページを作成するのと同じように、 /pages配下にtodo.tsxを作成し、/components/Layout.tsxに作成したtodoへのリンクを配置 します。 import Link from "next/link"; ... <Link
href="/todo"> <a>Todo</a> </Link>
実装の前に… 少しでも⾒た⽬をリッチに仕上げるためにmaterial-uiを⼊れます。 $ npm install @material-ui/core
Todoを実装する const [inputValue, setInputValue] = useState(""); const [todoList, setTodoList] =
useState<String[]>([]); const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => { event.preventDefault(); setTodoList([...todoList, inputValue]); setInputValue(""); }; return ( <Layout title="Todo"> <h1>Todo</h1> <form className={classes.root} noValidate autoComplete="off" onSubmit={handleSubmit}> <TextField id="task" label="Task" onChange={(e) => { setInputValue(e.target.value); }} value={inputValue} /> </form> <List component="nav" aria-label="secondary mailbox folders"> {todoList.map((todo) => ( <ListItem> <ListItemText primary={todo} /> </ListItem> ))} </List> </Layout> );
実際に動かしてみる
配布可能な状態にビルドする $ npm run dist 実⾏するとdist配下にdmgファイル等が⽣成されます。
まとめ 社内プロダクトで採⽤しているNext.jsの知識だけでデスクトップアプリを簡単に作るこ とができた。 production環境だとnext/linkの遷移がちゃんと⾏えなかったので改めて確認したい。
ご静聴ありがとうございました 参考 Next.js + Electron がとても簡単になっていた | Zenn https://zenn.dev/erukiti/articles/933fc127f751aef45b4f