electron-react | Project template for Electron with React support | Frontend Framework library
kandi X-RAY | electron-react Summary
kandi X-RAY | electron-react Summary
This template provides the following features pre-configured and ready to be developed with:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of electron-react
electron-react Key Features
electron-react Examples and Code Snippets
Community Discussions
Trending Discussions on electron-react
QUESTION
In a Electron-React-Typescript app I'm getting this error: Property 'api' does not exist on type 'Window & typeof globalThis'. window.api.send('open-type-A-window', '');
But in a file index.d.ts I declared interface Window in this way:
...ANSWER
Answered 2021-Apr-24 at 19:24I'm not familiar with React.js but I had the same issue with an Electron-Angular application. By adding the following declaration to my app.module.ts file it allows TypeScript to recognize the api
object in window.
You should be able to do the same by adding to your main module in your TS project.
QUESTION
I'm building a project based off the Electron React Boilerplate project. I am running MacOS 10.15.7 and node v14.15.1.
I'm trying to install sqlite3
package. Since it's a native dependency, I ran yarn add sqlite3
inside the src/
directory, like it says to do here. The compilation fails with the following output:
ANSWER
Answered 2021-Mar-10 at 22:12I downgraded the sqlite3 package to v5.0.0 and it rebuilt correctly. Hope this helps anyone else with the same issue.
Source: nodejs electronjs sqlite3 - use of undeclared identifier 'napi_is_detached_arraybuffer'
QUESTION
I want to make an Electronjs app with some of the react boilerplates. I guess the best one is the one with the most stars in github, but I am open to suggestions. My goal is to have one window, which is going to be the main one and another one that will be displayed only when the user clicks the Tray(https://github.com/sfatihk/electron-tray-window). What is the best solution, without using a second html and if possible without ejecting.
...ANSWER
Answered 2021-Feb-07 at 14:47You can use Tray in electron for this
Quote from the tray docuentation
Add icons and context menus to the system's notification area.
Example code:
QUESTION
I'm trying to implement autoupdate of my electron-react application using electron-updater and AWS S3 bucket. But getting error:
...ANSWER
Answered 2021-Feb-04 at 13:03As per the official documentation, you need to have something like this S3Options
AWS credentials are required, please see getting your credentials. Define
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
environment variables. Or in the~/.aws/credentials
.
QUESTION
I have cloned electron-react-boilerplate
from GitHub, which comes with Electron 11.0.1:
ANSWER
Answered 2021-Jan-30 at 19:11Electron 11 has a newer version of V8 JS engine which the native module usb@1.6.3
with a version of the std library not set to std=c++14
thus that doesn't support what V8 now requires.
This is known issue and you can read about it at these PRs #376, #394, #400 and the fix has been merged today (January 30 2021) with this PR #407 and there is a new release on NPM usb@1.6.4
.
Now your steps are working for me on Ubuntu 20.04 and ElectronRebuild.js
runs with no errors after installing latest usb
module:
QUESTION
I'm trying to use IPC to communicate between my react component and main electron process. In component :
...ANSWER
Answered 2021-Jan-19 at 22:00ipcRenderer
is the module you should, and do, use in the renderer process (either scripts attached to HTML pages if there is no contextIsolation
, or preload otherwise).
The module to use in the main process is called ipcMain
.
QUESTION
In the Electron Performance docs, the following is said:
In traditional Node.js development, we're used to putting all our
require()
statements at the top. If you're currently writing your Electron application using the same strategy and are using sizable modules that you do not immediately need, apply the same strategy and defer loading to a more opportune time.
So it recommends to allocate resources "just in time" calling require()
just when it is needed. The problem is that I'm trying to use electron-react-boilerplate
and TypeScript doesn't seem to support well this kind of code. Here is an example:
src/main.dev.ts
:
ANSWER
Answered 2021-Jan-12 at 13:28We can use an asynchronous import()
to solve that problem:
QUESTION
I've managed to build my react/electron app and have it run locally. However, the 'default' route for my app is /app
, so when my app runs locally, nothing shows up. This is what I have:
public/main.js:
...ANSWER
Answered 2020-Nov-30 at 05:02Turns out there's two parts to this answer; the first one was a typo. Instead of #/app
, adding #app
is correct (so the full string becomes file://${path.join(__dirname, "../build/index.html#app")}
).
The other issue is related to react-router-dom and the BrowserRouter
apparently; it doesn't work in production. So instead I have this:
QUESTION
I have a problem with tedious/webpack/node/electron? I'm not sure.
Steps to reproduce:
git clone https://github.com/codesbiome/electron-react-webpack-typescript-2020
yarn install
yarn add tedious
yarn add @types/tedious
then add following lines to App.tsx
(or anywhere else, just all it):
ANSWER
Answered 2020-Nov-20 at 18:12I figured it out.
Fix:
main.tsx
-> BrowserWindow
-> webPreferences
and change contextIsolation
to false
and also nodeIntegration
to true
.
After changing it, require reference error gone.
QUESTION
I am using the electron-react-boilerplate and want to open a component in a new BrowserWindow. There are multiple questions and answers on how to do this, but none of them are working after packaging the app.
Questions / Answers I've Found:
- How to handle multiple windows in Electron application with React.JS?
- electron-react-boilerplate :sub window on clicking a button
- https://stackoverflow.com/a/47926513/3822043
In my component I have tried to use the following lines to open a new window to a different route.
...ANSWER
Answered 2020-Aug-22 at 23:01Great timing. I was in the same boat the past few days, just figured it out. Except, I didn't change to HashRouter
like you did. Rather I left all the routing stuff as the default electron-react-boilerplate
comes with, like ConnectedRouter
. Maybe either way works.
__dirname
only works in dev. I used DebugTron to check what URLs were being loaded for each resource, and it was file://path/to/app.asar/something
. Then I figured out how to get the path to the asar. This worked for me in both dev and prod, regardless of where the application is located. You also need to set nodeIntegration: true
. Tested on macOS.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install electron-react
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page