Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Происходит эффект при изменении состояния компонента при уничтожении #1444

Open
ItMaga opened this issue Oct 7, 2024 · 0 comments
Labels

Comments

@ItMaga
Copy link
Member

ItMaga commented Oct 7, 2024

Проблема

Если при уничтожении компонента, попробовать изменить состояние компонента, то мы сталкиваемся с неожиданным поведением, когда у нас компонент оказывается уничтожен, но эффект после срабатывает на уничтоженном компоненте.

Одно из мест, где такое может происходить,

https://github.com/V4Fire/Client/blob/90b6fe5867f089d0a8e10967bc1eac085f961718/src/components/super/i-data/i-data.ts#L225...L236

Если в этом месте мы вызываем destroy, то мы попадем в колбэк ошибки и вызовем callSuper, который в свою очередь поменяет поле componentStatus, что вызовет update уже после уничтожения компонента

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants