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「; –