neutrino-preset-class-properties
v0.1.1
Published
Neutrino preset for using the newer class properties (fields) & static properties.
Downloads
3
Maintainers
Readme
neutrino-preset-class-properties
This project provides a Neutrino preset for transforming class properties. Uses the Babel Class properties transform which includes:
class Bork {
//Property initializer syntax
instanceProperty = "bork";
boundFunction = () => {
return this.instanceProperty;
}
//Static class properties
static staticProperty = "babelIsCool";
static staticFunction = function() {
return Bork.staticProperty;
}
}
If you're using Mobx with React, you'll need decorators, class properties and the React neutrino presets. Here's a single preset that will take care of that: jke-neutrino-preset-react-mobx
Usage
Create a project with a package.json
like this.
{
"name": "myapp",
"version": "1.0.0",
"config": {
"presets": [
"neutrino-preset-class-properties"
]
},
"scripts": {
"build": "neutrino build",
"start": "neutrino start"
},
"dependencies": {
},
"devDependencies": {
"neutrino": "^4.3.1",
"neutrino-preset-class-properties": "0.1.1"
}
}
Now you are ready to put your React components into src/
and start coding. Be aware that Neutrino creates the HTML template for you automatically. For more information see the web sites for Neutrino, React and MobX.
Peer dependencies
- neutrino: Used to run this project