巴贝尔崇高抛出错误

时间:2017-05-10 18:00:15

标签: reactjs sublimetext3 babeljs

我有以下ReactJS代码:

render() {
        return (
            <ValidatorForm onSubmit={this.handleSubmit}>
                <TextValidator
                    floatingLabelText="Password"
                    onChange={this.handleChange}
                    name="password"
                    type="password"
                    validators={['required']}
                    errorMessages={['this field is required']}
                    value={user.password}
                />
                <TextValidator
                    floatingLabelText="Repeat password"
                    onChange={this.handleChange}
                    name="repeatPassword"
                    type="password"
                    validators={['isPasswordMatch', 'required']}
                    errorMessages={['password mismatch', 'this field is required']}
                    value={user.repeatPassword}
                />
                <RaisedButton type="submit" />
            </ValidatorForm>
        );
    }

当我在Sublime中尝试Babel Transform时,我收到以下错误:

Error: SyntaxErrorD:/web dev/repos/myRepo/client/src/Modules/Register.js: Unexpected token (81:12)

  79 |     render() {
  80 |         return (
> 81 |             <ValidatorForm onSubmit={this.handleSubmit}>
     |             ^
  82 |                 <TextValidator
  83 |                     floatingLabelText="Password"
  84 |                     onChange={this.handleChange}

有没有人见过这个?我有一个可怕的时间试图找到一个以React方式完成所有事情的IDE - 尝试过Webstorm,Atom,VSCode等,但如果可能的话,我想坚持使用Sublime。

0 个答案:

没有答案