File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -191,8 +191,17 @@ export default function useStatus(
191191 activeRef . current = active ;
192192
193193 // ============================ Status ============================
194+ const visibleRef = useRef < boolean | null > ( null ) ;
195+
194196 // Update with new status
195197 useIsomorphicLayoutEffect ( ( ) => {
198+ // When use Suspense, the `visible` will repeat trigger,
199+ // But not real change of the `visible`, we need to skip it.
200+ // https://github.com/ant-design/ant-design/issues/44379
201+ if ( mountedRef . current && visibleRef . current === visible ) {
202+ return ;
203+ }
204+
196205 setAsyncVisible ( visible ) ;
197206
198207 const isMounted = mountedRef . current ;
@@ -232,6 +241,8 @@ export default function useStatus(
232241 // Set back in case no motion but prev status has prepare step
233242 setStatus ( STATUS_NONE ) ;
234243 }
244+
245+ visibleRef . current = visible ;
235246 } , [ visible ] ) ;
236247
237248 // ============================ Effect ============================
You can’t perform that action at this time.
0 commit comments