【发布时间】:2021-02-08 12:56:42
【问题描述】:
当我将以下代码添加到组件数据时,Axios 开始发出 GET 请求并且不再停止。不改变状态或不调用 setState 方法。
componentDidMount() {
axios('https://api.npms.io/v2/search?q=react')
.then(response => {
alert(response.data);
});
}
【问题讨论】: