Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fix electron issues #415

Open
onmyway133 opened this issue Sep 12, 2019 · 0 comments
Open

How to fix electron issues #415

onmyway133 opened this issue Sep 12, 2019 · 0 comments

Comments

@onmyway133
Copy link
Owner

onmyway133 commented Sep 12, 2019

Electron require() is not defined

https://stackoverflow.com/questions/44391448/electron-require-is-not-defined

function createWindow () {
  win = new BrowserWindow({
    title: 'MyApp',
    width: 600, 
    height: 500,
    resizable: false,
    icon: __dirname + '/Icon/Icon.icns',
    webPreferences: {
      nodeIntegration: true
    }
  })
}

DevTools was disconnected from the page

npm install babel-cli@latest --save-dev
npm install [email protected]
win.openDevTools()

This leads to Cannot find module 'react/lib/ReactComponentTreeHook'
If we're using binary, then rebuild, it is the problem that cause devTools not work

npx electron-builder

This goes to Cannot read property injection of undefined at react-tap-event-plugin

zilverline/react-tap-event-plugin#121

npm uninstall react-tap-event-plugin

This goes to Unknown event handler property onTouchTap in EnhancedButton in material-ui

Update material-ui

https://material-ui.com/
https://material-ui.com/guides/migration-v0x/#raised-button

npm install @material-ui/core

From

import RadioButtonGroup from '@material-ui/core/RadioButton/RadioButtonGroup'
import RadioButton from '@material-ui/core/RadioButton'
import RaisedButton from '@material-ui/core/RaisedButton'
import CardText from '@material-ui/core/Card/CardText'

to

import RadioButtonGroup from '@material-ui/core/RadioGroup'
import RadioButton from '@material-ui/core/Radio'
import RaisedButton from '@material-ui/core/Button'
import CardText from '@material-ui/core/DialogContentText'

Use FormControlLabel https://material-ui.com/components/radio-buttons/

<RadioGroup 
	style={styles.group} 
    defaultselected={this.state.choice} 
    onChange={this.handleChoiceChange}
    children={choiceElements} />
    {this.makeGenerateButton()}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant