11/* eslint-disable no-underscore-dangle,react/require-default-props */
22import * as React from 'react' ;
33import raf from './raf' ;
4- import Portal , { PortalRef } from './Portal' ;
4+ import Portal from './Portal' ;
5+ import type { PortalRef } from './Portal' ;
56import canUseDom from './Dom/canUseDom' ;
6- import switchScrollingEffect from './switchScrollingEffect' ;
77import setStyle from './setStyle' ;
88import ScrollLocker from './Dom/scrollLocker' ;
99
@@ -59,7 +59,7 @@ export interface PortalWrapperProps {
5959class PortalWrapper extends React . Component < PortalWrapperProps > {
6060 container ?: HTMLElement ;
6161
62- componentRef : React . RefObject < PortalRef > = React . createRef ( ) ;
62+ componentRef = React . createRef < PortalRef > ( ) ;
6363
6464 rafId ?: number ;
6565
@@ -73,8 +73,8 @@ class PortalWrapper extends React.Component<PortalWrapperProps> {
7373 }
7474
7575 renderComponent ?: ( info : {
76- afterClose : Function ;
77- onClose : Function ;
76+ afterClose : ( ... params : any [ ] ) => void ;
77+ onClose : ( ... params : any [ ] ) => void ;
7878 visible : boolean ;
7979 } ) => void ;
8080
@@ -206,7 +206,6 @@ class PortalWrapper extends React.Component<PortalWrapperProps> {
206206 */
207207 switchScrollingEffect = ( ) => {
208208 if ( openCount === 1 && ! Object . keys ( cacheOverflow ) . length ) {
209- switchScrollingEffect ( ) ;
210209 // Must be set after switchScrollingEffect
211210 cacheOverflow = setStyle ( {
212211 overflow : 'hidden' ,
@@ -216,7 +215,6 @@ class PortalWrapper extends React.Component<PortalWrapperProps> {
216215 } else if ( ! openCount ) {
217216 setStyle ( cacheOverflow ) ;
218217 cacheOverflow = { } ;
219- switchScrollingEffect ( true ) ;
220218 }
221219 } ;
222220
0 commit comments