We will modify this URL later to run independently without a hosted server so that it can be packaged and deployed easily. The window loads the development server URL. All we are doing here is adding a function createWindow which uses BrowserWindow from the electron package, to create a new window instance. We will keep the code to the bare minimum. We already have this as part of the react application. main.js - Starts the app and creates a browser window to render HTML. ![]() ![]() package.json - Points to the app's main file and lists its details and dependencies.npm install electronĪ basic Electron application needs just these files: The below command installs electron package. Now that we have a react application setup, let us integrate electron with it. The above commands will create an 'electron-react' folder with all the code and set up the app at in development mode. All you need to run are the below commands, and you have everything set up for a react application. With the create-react-app template generator, it is easy to setup and get up and running a react application. ![]() TDK react Setting up the React Application Recently I was playing around with an idea for a side project and decided to use Electron as I wanted a desktop application. Since then I was interested in learning more about developing an application using Electron. I was surprised when I first came across Electron to see many of the applications that I use daily was developed in electron and I never knew about it. Electron is a great way to build cross-platform desktop applications using HTML, CSS and JavaScript.
0 Comments
Leave a Reply. |