This note is about the Electron.
Proxy problem
> npm config set registry http://registry.npmjs.org/
Install electron problem (darwin)
> rm -rf ~/.electron/
> npm clear cache
> sudo npm install -g electron
Packaging app
> npm install -g electron-packager
// and also
> npm install -g electron-packager-interactive
// and then
> electron-packager . test --platform mas --arch x64 --version 1.4.4
–overwrite can be used to overwrite old app
–no-prune without this flag, modules are not included in app
ES2015
Babel is needed to converter the code
> babel -d app src
make file .babelrc
{
"presets": [
"es2015",
"react"
],
"plugins": []
}
in main.js if want to import then use const Person = PersonJS.default not only person since it is not written in ES6
React
> npm install and use as normal
dynamically update render(): state and setState are needed
when add a list of element key is needed for each element or it will have a warning
Bootstrap
there are several dependencies i choose react-bootstrap for test
event like onChange, onClick…… either this.handleChange = this.handleChange.bind(this); or (e) => this.handleChange(e)
Redux (Upcoming)
Webpack
> npm install webpack -g
竟然无法拒绝你的打赏
