你好吗?我有几个疑问!如何访问对象的继承?我正在尝试从具有“全球”的 NewConfirmed 获取数据
img Console.log: https ://i.stack.imgur.com/iJGcH.png
现在我只能获取数据“日期”
stats = () => {
const { dataCovid } = this.props;
if (this.props.loader) {
return (/**/ );
}
return (
<div className='row'>
<div className='col-md-4'>
<div className='card stat-card'>
<div className='card-body'>
<h5 className='card-title'>Total de Nuevos Contagio:</h5>
<h2 className='float-right'> {dataCovid.Date}</h2>
</div>
</div>
现在,如果我尝试调用 datacovid.Global,在控制台中我会得到以下信息:
Objects are not valid as a React child (found: object with keys {NewConfirmed, TotalConfirmed, NewDeaths, TotalDeaths, NewRecovered, TotalRecovered})
如果您分配了 NewConfimed 的值,它会抛出我
TypeError: dataCovid.Global is undefined
RISEBY
相关分类