GithubHelp home page GithubHelp logo

umbrella22 / electron-react-template Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 14.0 1.7 MB

An Electron & React quick start

License: Other

JavaScript 2.23% HTML 7.28% TypeScript 86.76% SCSS 3.73%
react antdesign axios electron-react-typescript-template electron nodejs vite

electron-react-template's Introduction

Electron-React-template

How to use

npm install or yarn install

npm run dev or yarn dev

# 启动之后,会在9080端口监听
# 需要重新运行一次此命令
npm run dev

# build命令在不同系统环境中,需要的的不一样,需要自己根据自身环境进行配置
npm run build

# 如若实在不行无法安装electron依赖,请使用
npm config edit
# 该命令会打开npm的配置文件,请在registry=https://registry.npm.taobao.org/这行代码后的下一行添加
# electron_mirror=https://cdn.npm.taobao.org/dist/electron/  和  ELECTRON_BUILDER_BINARIES_MIRROR=http://npm.taobao.org/mirrors/electron-builder-binaries/
# 然后关闭该窗口,重启命令行,删除node_modules文件夹,并重新安装依赖即可

electron-react-template's People

Contributors

orziz avatar umbrella22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

electron-react-template's Issues

引入antd 运行报错

引入antd 运行报错,是在哪里需要配置嘛
webpack-internal:///…evelopment.js:20085 The above error occurred in the component:

at Button (/Applications/pro/electron-react-template-master/node_modules/antd/lib/button/button.js:137:30)
at div
at App

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
webpack-internal:///…evelopment.js:23270 Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app
    See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    at resolveDispatcher (:9080/Applications/p…development.js:1476)
    at Object.useContext (:9080/Applications/p…development.js:1484)
    at Button (:9080/Applications/p…utton/button.js:155)
    at renderWithHooks (webpack-internal:///…evelopment.js:14985)
    at updateForwardRef (webpack-internal:///…evelopment.js:17044)
    at beginWork (webpack-internal:///…evelopment.js:19098)
    at HTMLUnknownElement.callCallback (webpack-internal:///…development.js:3945)
    at Object.invokeGuardedCallbackDev (webpack-internal:///…development.js:3994)
    at invokeGuardedCallback (webpack-internal:///…development.js:4056)
    at beginWork$1 (webpack-internal:///…evelopment.js:23959)

build:web babel报错

Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /Users/tianjinsha/Documents/electron-react-template-master/src/renderer/view/app/App.tsx: Missing initializer in const declaration. (9:9)

7 | import TitleBar from "@/components/common/TitleBar"
8 |

9 | const App: FC = () => {
| ^
10 | return (
11 |


12 |

at instantiate (/Users/tianjinsha/Documents/electron-react-template-master/node_modules/@babel/parser/lib/index.js:72:32)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.