<div className={classes.preview}>
{Array.isArray(value) &&
value.length > 0 &&
value.map((item) =>
!item.label ? (
`----`
) : dataFromApi ? (
<span key={item.value}>{`${item.label} `}</span>
) : (
t(`${item.label}`)
),
)}
{!Array.isArray(value) && value}
</div>
我这样写会报以下错误,是哪里的问题呢?
Error: Objects are not valid as a React child (found: object with keys {label, value}). If you meant to render a collection of children, use an array instead.