编译一个简单的 React 应用程序时,我在文件的最后(空白)行收到一条错误消息,提示“意外的令牌”
import { Link, Redirect } from "react-router-dom";
import './App.css';
class Companies extends Component {
constructor(props) {
super(props);
var user = null;
if (props.hasOwnProperty("user")){
user = props["user"];
}
this.state = {
user: user,
companies: [],
};
}
}
export Companies
是我试图运行的代码
Failed to compile.
./src/Companies.js
Line 22:1: Parsing error: Unexpected token
20 |
21 | export Companies
> 22 |
| ^
是我收到的错误信息。
白猪掌柜的
相关分类