Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1409 from 18F/ch-babelrc-arrow-func-config
Browse files Browse the repository at this point in the history
Update .babelrc to understand class arrow functions
  • Loading branch information
gidjin authored Feb 13, 2019
2 parents bf4c4b5 + 76b90ce commit 3621aa6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"presets": ["es2015", "react", "stage-2"]
"presets": ["es2015", "react", "stage-2"],
"plugins": ["transform-class-properties"]
}
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
es6: true
node: true
jest: true
parser: babel-eslint
parserOptions:
ecmaVersion: 9
sourceType: module
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^10.0.1",
"babel-loader": "^7.1.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-2": "^6.24.1",
Expand Down
22 changes: 7 additions & 15 deletions src/components/Section/Package/ValidForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,12 @@ export default class ValidForm extends ValidationElement {
constructor(props) {
super(props)

this.update = this.update.bind(this)
this.updateComments = this.updateComments.bind(this)
this.updateGeneral = this.updateGeneral.bind(this)
this.updateMedical = this.updateMedical.bind(this)
this.updateCredit = this.updateCredit.bind(this)
this.accordionItems = this.accordionItems.bind(this)
this.submit = this.submit.bind(this)

this.state = {
accordionItems: this.accordionItems()
}
}

update(queue) {
update = (queue) => {
this.props.onUpdate({
AdditionalComments: this.props.AdditionalComments,
General: this.props.General,
Expand All @@ -42,31 +34,31 @@ export default class ValidForm extends ValidationElement {
})
}

updateComments(values) {
updateComments = (values) => {
this.update({
AdditionalComments: values
})
}

updateGeneral(values) {
updateGeneral = (values) => {
this.update({
General: values
})
}

updateMedical(values) {
updateMedical = (values) => {
this.update({
Medical: values
})
}

updateCredit(values) {
updateCredit = (values) => {
this.update({
Credit: values
})
}

submit() {
submit = () => {
if (window.confirm('Are you sure you want to submit this application?')) {
this.props.onSubmit()
}
Expand All @@ -91,7 +83,7 @@ export default class ValidForm extends ValidationElement {
}
}

accordionItems() {
accordionItems = () => {
const self = this
return [
{
Expand Down

0 comments on commit 3621aa6

Please sign in to comment.