我使用axios从API检索数据,并试图将数据保存在一个处于组件状态的数组中的变量中,但是当我这样做时,我得到了错误:
Objects are not valid as a React child (found: object with keys If you meant to render a collection of children, use an array instead.
我试着在线查看并将对象转换为数组,但到目前为止没有任何进展。以下是我所做的努力:
import React, { useState, useEffect, Component } from 'react