This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
var path = require("path"); | |
require("babel-polyfill"); | |
module.exports = { | |
context: path.join(__dirname, "src"), | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: ["babel-polyfill", "./" + path.join("js", "scripts.js")], | |
module: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidMount(){ | |
document.title = "Store Profile" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class BindFunctionExample extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
hidden: true, | |
}; | |
this.toggleHidden = this.toggleHidden.bind(this); | |
} | |
toggleHidden() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class SetValueExample extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
myName: '', | |
}; | |
} | |
setValue(e) { | |
this.setState({[e.target.name]: e.target.value}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"eslint": "eslint", | |
"lint": "eslint --config .eslintrc.json --format compact .", | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "webpack --debug", | |
"buildProduction": "webpack --progress -p", | |
"deployMac": "./build_helpers/buildDist.sh", | |
"deployWin": "./build_helpers/buildDist.exe", | |
"dev": "webpack-dev-server --content-base src --inline --hot", | |
"devhttps": "webpack-dev-server --content-base src --inline --hot --https", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
PATH=$(npm bin):$PATH | |
rm -rf ./dist | |
NODE_ENV=production | |
webpack --progress -p | |
COMPRESS=1 webpack | |
npm run deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
export default class LoginForm extends React.Component { | |
render(){ | |
return( | |
<form> | |
<p>Login</p> | |
<div className="label-input"> | |
<label>Email Address</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import LabelInput from "./LabelInput"; | |
export default class LoginForm extends React.Component { | |
render(){ | |
const {email, password, onSubmit, onChange} = this.props; | |
return( | |
<form> | |
<p>Login</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var object1 = {color: "blue", size: 12}; | |
var object2 = object1 | |
object2.color = "red" | |
object1 === object2 //true | |
object3 = Object.assign({}, object1) | |
object3.color = "red" | |
object1 === object3 //false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
export default class Login extends React.Component { | |
state = { | |
email: "", | |
password: "" | |
} | |
//THIS IS A DIFFERENT WAY TO BIND THIS TO THE FUNCTION |