移除路由动画试图保留行为, 杂物

This commit is contained in:
CrescentLeaf
2025-12-27 00:49:16 +08:00
parent 2ad2e6e863
commit 1e2e90f9e7
6 changed files with 10 additions and 16 deletions

View File

@@ -7,8 +7,12 @@ import RouterDialogsContext from './RouterDialogsContext'
export default function useRouterDialogRef() {
const dialogRef = React.useRef<Dialog>()
const nav = useNavigate()
useAsyncEffect(async () => {
dialogRef.current!.addEventListener('closed', async () => {
nav(-1)
})
await sleep(10)
dialogRef.current!.open = true
}, [])