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
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
Building an Out-of-Order CPU
latte72
1
770
Intent as Code
shoppingjaws
6
980
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
450
What We Talk About When We Talk About XP
m_seki
2
610
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
1.2k
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.6k
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
980
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
240
XHTMLが残したもの
yosuke_furukawa
PRO
2
770
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
670
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
180
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
150
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
Agile that works and the tools we love
rasmusluckow
331
22k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Balancing Empowerment & Direction
lara
6
1.3k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
900
Practical Orchestrator
shlominoach
191
12k
Being A Developer After 40
akosma
91
590k
Six Lessons from altMBA
skipperchong
29
4.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
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