正确地包裹反应组件

时间:2016-12-15 05:58:41

标签: javascript reactjs

我试图包装以下函数,该函数返回呈现名片的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>

0 个答案:

没有答案