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 6464 "classnames" : " ^2.2.6" ,
6565 "rc-align" : " ^4.0.0" ,
6666 "rc-motion" : " ^2.0.0" ,
67- "rc-util" : " ^5.5.0 "
67+ "rc-util" : " ^5.19.2 "
6868 },
6969 "peerDependencies" : {
7070 "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' ;
22import raf from 'rc-util/lib/raf' ;
3+ import useState from 'rc-util/lib/hooks/useState' ;
34
45/**
56 * Popup should follow the steps for each component work correctly:
@@ -23,14 +24,11 @@ export default (
2324) : [ PopupStatus , ( callback ?: ( ) => void ) => void ] => {
2425 const [ status , setInternalStatus ] = useState < PopupStatus > ( null ) ;
2526 const rafRef = useRef < number > ( ) ;
26- const destroyRef = useRef ( false ) ;
2727
2828 function setStatus (
2929 nextStatus : PopupStatus | ( ( prevStatus : PopupStatus ) => PopupStatus ) ,
3030 ) {
31- if ( ! destroyRef . current ) {
32- setInternalStatus ( nextStatus ) ;
33- }
31+ setInternalStatus ( nextStatus , true ) ;
3432 }
3533
3634 function cancelRaf ( ) {
@@ -84,7 +82,6 @@ export default (
8482
8583 useEffect (
8684 ( ) => ( ) => {
87- destroyRef . current = true ;
8885 cancelRaf ( ) ;
8986 } ,
9087 [ ] ,
You can’t perform that action at this time.
0 commit comments