React - “Unexpected token” when initialising state
问题 I'm fairly new to React, so please forgive any errors in this question! I'm currently trying to get a basic login form working: import React, { Component } from 'react'; import { Input, Form, Button } from 'semantic-ui-react' class LoginForm extends Component { state = { username: '', password: '' } handleChange = (e, { name, value }) => this.setState({ [name]: value }) handleSignIn(e) { e.preventDefault() this.props.onSignIn(this.username, this.password) } render() { const { username,