refactor: import react-slick instead of require (#22507)

* refactor: import react-slick instead of require

close #22501

* Update index.tsx
This commit is contained in:
偏右 2020-03-23 11:38:16 +08:00 committed by GitHub
parent 011cac4414
commit e2a9ab4204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,15 +1,9 @@
import * as React from 'react';
import debounce from 'lodash/debounce';
import { Settings } from '@ant-design/react-slick';
import SlickCarousel, { Settings } from '@ant-design/react-slick';
import classNames from 'classnames';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
// Use require over import (will be lifted up)
// make sure matchMedia polyfill run before require('react-slick')
// Fix https://github.com/ant-design/ant-design/issues/6560
// Fix https://github.com/ant-design/ant-design/issues/3308
const SlickCarousel = require('@ant-design/react-slick').default;
export type CarouselEffect = 'scrollx' | 'fade';
export type DotPosition = 'top' | 'bottom' | 'left' | 'right';