Skip to content

iNiL0119/react-electron-quick-start

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React与Electron项目创建

  1. 创建React项目:npx create-react-app react-electron-quick-start
  2. 进入项目:cd react-electron-quick-start
  3. 运行React项目:yarn start / yarn run start(个人习惯用后者)
  4. 安装electron包:yarn add electron --dev
  5. 新建Electron入口文件main.js,内容与electron-quick-start中的main.js内容相同,只是需要将窗口加载地址修改为项目url地址(mainWindow.loadFile('index.html') -> mainWindow.loadURL('http://localhost:3000/')
  6. 修改package.json文件,新增"main": "main.js", "homepage": ".", "scripts"中新增"electron": "electron ."
  7. 运行yarn run start
  8. 运行yarn run electron

About

The quick start demo for react and electron

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published