2016-10-03 78 views

回答

0

你需要第一資源解析成JSON

fetch('https://api.chooin.com/v1/product/index') 
    .then(res => res.json()) 
    .then(data => { 
     return this.setState({ 
      loaded: true, 
      products: this.state.products.cloneWithRows(data.subjects) 
     }); 
    }) 
    .catch(err => console.log(err)); 

看看這裏https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

+0

我解析第一個資源,但也請求失敗。 – Devin

+0

我使用iOS8.3它正在工作 – Devin

+0

我可以看到錯誤嗎? – EQuimper

相關問題