File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 64
64
"classnames" : " ^2.2.6" ,
65
65
"rc-align" : " ^4.0.0" ,
66
66
"rc-motion" : " ^2.0.0" ,
67
- "rc-util" : " ^5.5.0 "
67
+ "rc-util" : " ^5.19.2 "
68
68
},
69
69
"peerDependencies" : {
70
70
"react" : " >=16.9.0" ,
Original file line number Diff line number Diff line change 1
- import { useState , useEffect , useRef } from 'react' ;
1
+ import { useEffect , useRef } from 'react' ;
2
2
import raf from 'rc-util/lib/raf' ;
3
+ import useState from 'rc-util/lib/hooks/useState' ;
3
4
4
5
/**
5
6
* Popup should follow the steps for each component work correctly:
@@ -23,14 +24,11 @@ export default (
23
24
) : [ PopupStatus , ( callback ?: ( ) => void ) => void ] => {
24
25
const [ status , setInternalStatus ] = useState < PopupStatus > ( null ) ;
25
26
const rafRef = useRef < number > ( ) ;
26
- const destroyRef = useRef ( false ) ;
27
27
28
28
function setStatus (
29
29
nextStatus : PopupStatus | ( ( prevStatus : PopupStatus ) => PopupStatus ) ,
30
30
) {
31
- if ( ! destroyRef . current ) {
32
- setInternalStatus ( nextStatus ) ;
33
- }
31
+ setInternalStatus ( nextStatus , true ) ;
34
32
}
35
33
36
34
function cancelRaf ( ) {
@@ -84,7 +82,6 @@ export default (
84
82
85
83
useEffect (
86
84
( ) => ( ) => {
87
- destroyRef . current = true ;
88
85
cancelRaf ( ) ;
89
86
} ,
90
87
[ ] ,
You can’t perform that action at this time.
0 commit comments