- 创建React项目:npx create-react-app react-electron-quick-start
- 进入项目:cd react-electron-quick-start
- 运行React项目:yarn start / yarn run start(个人习惯用后者)
- 安装electron包:yarn add electron --dev
- 新建Electron入口文件main.js,内容与electron-quick-start中的main.js内容相同,只是需要将窗口加载地址修改为项目url地址(mainWindow.loadFile('index.html') -> mainWindow.loadURL('http://localhost:3000/')
- 修改package.json文件,新增"main": "main.js", "homepage": ".", "scripts"中新增"electron": "electron ."
- 运行yarn run start
- 运行yarn run electron
-
Notifications
You must be signed in to change notification settings - Fork 0
iNiL0119/react-electron-quick-start
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
The quick start demo for react and electron
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published