{"action":"created","issue":{"url":"https://api.github.com/repos/gaearon/react-transform-boilerplate/issues/97","labels_url":"https://api.github.com/repos/gaearon/react-transform-boilerplate/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/gaearon/react-transform-boilerplate/issues/97/comments","events_url":"https://api.github.com/repos/gaearon/react-transform-boilerplate/issues/97/events","html_url":"https://github.com/gaearon/react-transform-boilerplate/issues/97","id":125909464,"number":97,"title":"Cannot use `Property Initializers` with babel-preset-stage-0","user":{"login":"leiming","id":2059859,"avatar_url":"https://avatars.githubusercontent.com/u/2059859?v=3","gravatar_id":"","url":"https://api.github.com/users/leiming","html_url":"https://github.com/leiming","followers_url":"https://api.github.com/users/leiming/followers","following_url":"https://api.github.com/users/leiming/following{/other_user}","gists_url":"https://api.github.com/users/leiming/gists{/gist_id}","starred_url":"https://api.github.com/users/leiming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leiming/subscriptions","organizations_url":"https://api.github.com/users/leiming/orgs","repos_url":"https://api.github.com/users/leiming/repos","events_url":"https://api.github.com/users/leiming/events{/privacy}","received_events_url":"https://api.github.com/users/leiming/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-11T09:57:05Z","updated_at":"2016-01-11T10:52:47Z","closed_at":"2016-01-11T10:52:47Z","body":"Hi, I couldn't use [Property Initializers](https://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#es7-property-initializers) with Babel 2015.\r\n\r\nAll code in scenario as follow:\r\n\r\nrun in bash:\r\n```bash\r\n npm install babel-preset-stage-0 --save-dev\r\n```\r\n\r\n.babelrc\r\n```json\r\n{\r\n  \"presets\": [\"react\", \"es2015\", \"stage-0\"],\r\n  \"env\": {\r\n    \"development\": {\r\n      \"presets\": [\"react-hmre\", \"stage-0\"]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n\r\nsrc/App.js\r\n```js\r\nclass Counter extends Component {\r\n\r\n  static props = {\r\n    bar : 'foo'\r\n  }\r\n\r\n  render() {<div>anything</div>}\r\n}\r\n```\r\n\r\nAnd run `npm start`, console throw the error:\r\n\r\n```js\r\n// ...\r\n\r\n  [165] ./~/react/lib/onlyChild.js 1.21 kB {0} [built]\r\n  [166] ./~/react/lib/deprecated.js 1.77 kB {0} [built]\r\n  [167] ./~/react-dom/index.js 63 bytes {0} [built]\r\n\r\nERROR in ./src/App.js\r\nModule build failed: SyntaxError: /Users/leiming/IdeaProjects/react_new/react-transform-boilerplate/src/App.js: A semicolon is required after a class property (8:3)\r\n   6 |   static props = {\r\n   7 |     bar : 'foo'\r\n>  8 |   }\r\n     |    ^\r\n   9 | \r\n  10 |   constructor(props) {\r\n  11 |     super(props);\r\n\r\n// ...\r\n```\r\n\r\nCould you tell me the proper method about using `babel-loader`?"},"comment":{"url":"https://api.github.com/repos/gaearon/react-transform-boilerplate/issues/comments/170507647","html_url":"https://github.com/gaearon/react-transform-boilerplate/issues/97#issuecomment-170507647","issue_url":"https://api.github.com/repos/gaearon/react-transform-boilerplate/issues/97","id":170507647,"user":{"login":"leiming","id":2059859,"avatar_url":"https://avatars.githubusercontent.com/u/2059859?v=3","gravatar_id":"","url":"https://api.github.com/users/leiming","html_url":"https://github.com/leiming","followers_url":"https://api.github.com/users/leiming/followers","following_url":"https://api.github.com/users/leiming/following{/other_user}","gists_url":"https://api.github.com/users/leiming/gists{/gist_id}","starred_url":"https://api.github.com/users/leiming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leiming/subscriptions","organizations_url":"https://api.github.com/users/leiming/orgs","repos_url":"https://api.github.com/users/leiming/repos","events_url":"https://api.github.com/users/leiming/events{/privacy}","received_events_url":"https://api.github.com/users/leiming/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T10:52:46Z","updated_at":"2016-01-11T10:52:46Z","body":"According to `A semicolon is required after a class property`, having replaced \r\n\r\n```js\r\n  static props = { bar : 'foo'}\r\n```\r\n\r\nwith\r\n\r\n```js\r\n  static props = {bar : 'foo'};\r\n```\r\n\r\ncan solve the problem, even thorough the semicolon is not necessary with Babel 5 ."}}