Parentheses are needed around destructured parameters.
({ id, ...otherCollectionProps }) => ()
You should also return the JSX with either return
or with simple parentheses as well (instead of curly braces).
const { collections } = this.state;
return (
<div className="shop-page">
{collections.map(({ id, ...otherCollectionProps }) => {
return <PreviewCollection key={id} {...otherCollectionProps} />;
})}
</div>
);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…