如果将第17行替换为加密信息?.map.我在useState挂钩中使用了加密信息.这是由于useState中的错误导致的吗
const Cryptocurrencies = ({ simplified }) => {
let count = simplified ? 10 : 100;
const { data: cryptoList, isFetching } = useGetCryptosQuery(count);
const [cryptoInfo, setCryptoInfo] = useState(cryptoList?.data?.coins);
console.log(cryptoInfo);
if (isFetching) return "Loading...";
return (
<>
<Row gutter={[16, 16]} className="crypto-card-container">
{cryptoList?.data?.coins?.map((currency) => (
<Col
xs={24}
sm={12}
xl={6}
className="crypto-card"
key={currency.uuid}
>
</Col>
))}
</Row>
</>
);
};
export default Cryptocurrencies;