Objects are not valid as a React child (found: object with keys {batchUnits, totalBatchIndex, batchRange, lastBatchInEnv, batchNum, envBatchIndex, lastBatch, env, waitTimeAfterBatch}). If you meant to render a collection of children, use an array instead.
在react中不能用object作为children渲染一个组件,只允许strings或者numbers
const myObject = { key1: 'value1', key2: 'value2' };
return (
<div>{myObject}</div>
);
改为:
const myObject = { key1: 'value1', key2: 'value2' };
return (
<div>{Object.values(myObject)}</div>
);