---
title: "Discussion on \"Modal里面状态切换的导致Flickering问题\" | Hashnode"
description: "Discussion on \"Modal里面状态切换的导致Flickering问题\". 如果在modal外面管理状态，在关闭弹窗的时候，因为需要清理状态，弹窗内容会flicking。\n\n解决办法1：在modal的onCompleted或者onExitEnd之类的callback里清理状态。\n\n解决办法2：\n\n\n\n\n    ？？？比如我用的是react-aria-components这个库，没有提供这个方法。\n    可以使用https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations#examples ..."
url: "https://hashnode.com/posts/modalflickering/68b94a4ae7fa96617a1a0a22"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Modal里面状态切换的导致Flickering问题](https://landay.hashnode.dev/modalflickering?utm_source=hashnode&utm_medium=feed)

如果在modal外面管理状态，在关闭弹窗的时候，因为需要清理状态，弹窗内容会flicking。 解决办法1：在modal的onCompleted或者onExitEnd之类的callback里清理状态。 解决办法2： ？？？比如我用的是react-aria-components这个库，没有提供这个方法。 可以使用https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations#examples ...

Sep 4, 2025 · 1 min read · landay.hashnode.dev  
Updated Sep 12, 2025  
Read the article

## Written by

[Landay](https://hashnode.com/@Landay)

@Landay

  
[View profile](https://hashnode.com/@Landay)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
