我再编译时出现Missing semicolon 如下图 错误出现在29行 下面标注的阔号配对。 其实原因很简单就是函数放错了位置 componentDidMount()函数放在了constructor()内分开放就好了 如图现在就没问题了。