File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -76,17 +76,19 @@ export default function useStatus(
7676 return ;
7777 }
7878
79+ const currentActive = activeRef . current ;
80+
7981 let canEnd : boolean | void ;
80- if ( status === STATUS_APPEAR && activeRef . current ) {
82+ if ( status === STATUS_APPEAR && currentActive ) {
8183 canEnd = onAppearEnd ?.( element , event ) ;
82- } else if ( status === STATUS_ENTER && activeRef . current ) {
84+ } else if ( status === STATUS_ENTER && currentActive ) {
8385 canEnd = onEnterEnd ?.( element , event ) ;
84- } else if ( status === STATUS_LEAVE && activeRef . current ) {
86+ } else if ( status === STATUS_LEAVE && currentActive ) {
8587 canEnd = onLeaveEnd ?.( element , event ) ;
8688 }
8789
8890 // Only update status when `canEnd` and not destroyed
89- if ( canEnd !== false ) {
91+ if ( status !== STATUS_NONE && currentActive && canEnd !== false ) {
9092 setStatus ( STATUS_NONE , true ) ;
9193 setStyle ( null , true ) ;
9294 }
You can’t perform that action at this time.
0 commit comments