Browse Source

Fix carousel react 15 support

pull/18209/head
afc163 5 years ago
parent
commit
e5a83dd884
  1. 4
      components/carousel/index.tsx

4
components/carousel/index.tsx

@ -1,6 +1,7 @@
import * as React from 'react';
import debounce from 'lodash/debounce';
import { Settings } from 'react-slick';
import { polyfill } from 'react-lifecycles-compat';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import warning from '../_util/warning';
@ -21,8 +22,7 @@ if (typeof window !== 'undefined') {
// 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('react-slick').default;
const SlickCarousel = polyfill(require('react-slick').default);
export type CarouselEffect = 'scrollx' | 'fade';
export type DotPosition = 'top' | 'bottom' | 'left' | 'right';

Loading…
Cancel
Save