Swiper
이라는 구성 요소를 내보내는 react-id-swiper
라이브러리를 사용하고 싶습니다.React 구성 요소의 렌더링 만 변경하는 방법
render() {
const { containerClass, wrapperClass, children, rtl } = this.props;
const rtlProp = rtl ? { dir: 'rtl' } : {};
return (
<div className={containerClass} {...rtlProp}>
{this.renderParallax()}
<div className={wrapperClass}>
{React.Children.map(children, this.renderContent)}
</div>
{this.renderPagination()}
{this.renderScrollBar()}
{this.renderNextButton()}
{this.renderPrevButton()}
</div>
);
}
}
이 구성 요소가 완벽하게 내가합니다 (containerClass
요소의 외부) 외부 장소에 페이지 매김을 배치해야하는 것을 제외하고, 내 요구를 일치 : 이는 render
방법이다.
가능한 한 가지 해결책은 Swiper
클래스를 상속하고 변경하는 것입니다. render
메서드입니다. 그러나 페이스 북의 문서는 상속을 사용하지 않고 컴포지션을 사용하는 것으로 명시되어 있습니다.
containerClass
외부의 페이지 매김을 이동시키는 가장 좋은 방법은 무엇입니까? 작곡을 할 수 있습니까?