Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import classNames from 'classnames';
import React, { FC, MutableRefObject, ReactNode, useEffect, useMemo, useRef, useState } from 'react';
import { SwiperOptions } from 'swiper';
import { Autoplay, Navigation, Pagination, Swiper as OriginalSwiper } from 'swiper/dist/js/swiper.esm.js';
import { createUniqIDGenerator } from '../../utils/createUniqIDGenerator';
import { DefaultNavigation } from './DefaultNavigation';
OriginalSwiper.use([Navigation, Pagination, Autoplay]);
export type SwiperInstance = OriginalSwiper;
export interface SwiperProps extends SwiperOptions {
children?: ReactNode;
navigationChildren?: ReactNode;
paginationChildren?: ReactNode;
getSwiperInstance?: (swiperInstance: OriginalSwiper) => void;
className?: string;
}
const generateId = createUniqIDGenerator('swiper-');
export const Swiper: FC = ({
getSwiperInstance,
className,