setting up babel locally.
bable plugins/ presets
env preset
yarn global add [email protected] --didn't work-- causes problems ("alias unavailable with yarn g install);
npm i [email protected] √
yarn init
yarn add [email protected] [email protected]
FROM CL...
babel src/app.js --out-file=public/scripts/app.js --presets=env,react --watch
THIS IS WORKING!
./node_modules/.bin/babel src/app.js --out-file=public/scripts/app.js --presets=env,react --watch
const optionEntry = e.target.elements.choiceInput.value; // inside formSubmit
<form onSubmit={onFormSubmit}>
<input type="text" name="choiceInput"/>
<button>Add Option</button>
</form>
// If you have content flashing or a refresh, make sure to make the method accept the evt param and then
//
...
evt.preventDefault();
...
adding options into html from form
disabled state of button
solve error: "Cannot read property props of null" (or "...undefined") hint: lost binding :)
if (!error) {
evt.target.elements.optionField.value = '';
}
yarn add [email protected] [email protected]
"cheap-module-eval-sourcemap"
module: {
rules: [
{
loader: 'babel-loader',
test: /\.js$/,
exclude: /node_modules/
},
{
test: /\.scss$/,
use: ['style-loader','css-loader', 'sass-loader']
}
]
},
by default 1rem = 16px;
html { font-size: 62.5%; This changes the rem to a base-10 system (because 16 * .625 = 10)
So... 2.2rem = 22px, etc etc.
}
yarn add normalize.css