Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import PerfectScrollbarType, * as PerfectScrollbarNamespace from 'perfect-scrollbar';
import psStyles from 'perfect-scrollbar/css/perfect-scrollbar.css';
import { OptionsContext } from '../components/OptionsProvider';
import styled, { createGlobalStyle } from '../styled-components';
/*
* perfect scrollbar umd bundle uses exports assignment while module uses default export
* so when bundled with webpack default export works but with jest it crashes
* That's why the following ugly fix is required
*/
const PerfectScrollbarConstructor =
PerfectScrollbarNamespace.default || ((PerfectScrollbarNamespace as any) as PerfectScrollbarType);
const PSStyling = createGlobalStyle`${psStyles && psStyles.toString()}`;
const StyledScrollWrapper = styled.div`
position: relative;
`;
export interface PerfectScrollbarProps {
options?: PerfectScrollbarType.Options;
className?: string;
updateFn?: (fn) => void;
}
export class PerfectScrollbar extends React.Component {
private _container: HTMLElement;
private inst: PerfectScrollbarType;
componentDidMount() {