ここは自分のコードです。ページにデータを表示する方法がわかりません。私が試したとき、私は、ページには何も持っていないし、それは示していますAPIデータを取得してreact.jsの表形式で表示する方法
警告:配列やイテレータ内の各子供はユニークな「キー」 小道具を持っている必要があります。
ここは私のコードです。
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor(){
super();
this.state = {
data: []
}
}
componentDidMount()
{
fetch("https://blockchain.info/ticker").
then((Response) => Response.json()).
then ((findresponse)=>
{
console.log(findresponse)
this.setState({
data: [findresponse]
});
})
}
render()
{
return(
<div>
{
this.state.data.map((dynamicData, Key) =>
<div>
<span>{dynamicData.key}</span>
</div>
)
}
</div>
)
}
}
export default App;
'findresponse'はどのように見えますか?ここに角括弧が必要ですか?data:[findresponse] '? – Walk