Add support for null in RenderControl type

Allow null to completely disable default controls.
This commit is contained in:
Rémi Chanaud
2018-06-19 11:30:49 +02:00
committed by Rémi Chanaud
parent 085e63ecf0
commit 01306ebd53
2 changed files with 2 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ export interface SlideRenderControlProps {
goToSlide: (index: number) => void;
}
export type RenderControl = (props: SlideRenderControlProps) => JSX.Element;
export type RenderControl = (props: SlideRenderControlProps) => JSX.Element | null;
export interface CarouselProps {
/**

View File

@@ -25,7 +25,7 @@ const props: CarouselProps = {
renderCenterCenterControls: () => <button />,
renderCenterRightControls: () => <button />,
renderBottomLeftControls: () => <button />,
renderBottomCenterControls: () => <button />,
renderBottomCenterControls: () => null,
renderBottomRightControls: () => <button />,
slideIndex: 2,
slidesToScroll: 'auto',