1
如何使用同构取我收到错误@类型/同构取没有缺省出口获取在打字稿
import fetch from 'isomorphic-fetch';
export const AUTH_FAIL = "AUTH_FAIL"
export const ERROR_FETCH = "EROR_FETCH";
export const SUCCESS_FETCH = "SUCESS_FETCH";
export const START_FETCH = "START_FETCH";
export function start_fetch(){
return function(dispatch: any){
return fetch("http://localhost:8000/api/data")
.then(
response => response.json()
)
}
}
感谢您的帮助。
您是否尝试使用npm安装它? npm install @ types/isomorphic-fetch 并导入取回,如下所示: import * as'fecth from'isomorphic-fetch“; –