我有以下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。