我试图包装以下函数,该函数返回呈现名片的BusinessReviewsCardContainer
当前代码
const renderIfData = ( lineup ) => {
if ( lineup ) {
return lineup[0].competitors.map( ( competitor) => {
return <BusinessReviewsCardContainer key={competitor._globalId} data={competitor} />
});
} else {
return <h4>No reviews yet!</h4>;
}
};
export const LineupsReputation = ( { lineup } ) => (
<div>
{ renderIfData( lineup ) }
</div>
);
我想换<BusinessReviewsCardContainer key={competitor._globalId} data={competitor} />
使用以下内容,它会在滑块中呈现所有名片
<Slider {...settings}>
</Slider>