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

fix(snackbar): fix show animation on new architecture #4447

Merged

Conversation

seb-zabielski
Copy link
Contributor

@seb-zabielski seb-zabielski commented Jul 1, 2024

Motivation

This bug is only available on android with new architecture enabled and is well described (with and example) in the related issue #4445
From what I've been able to find, the problem occurs when the animation is started before the component is rendered.
In our scenario, the component returns null as long as the hidden state is set to true. In the handleOnVisible function we have the main steps setHidden(false) and Animation start. To fix the bug, I moved the start of the animation to a useEffect that depends on the hidden value, so that the animation will start after the state is changed (and component re-rendered).

btw, since this bug only occurs with the new architecture, it is either also a react-native bug or an expected change. I have not found an answer yet.

Related issue

#4445

Test plan

Run android app with New Architecture enabled and try to show/hide snackbar.

Before After
Screen.Recording.2024-07-01.at.09.47.14.mov
Screen.Recording.2024-07-01.at.09.44.12.mov

@seb-zabielski seb-zabielski requested a review from gedu July 1, 2024 07:50
@callstack-bot
Copy link

Hey @seb-zabielski, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@iM-GeeKy
Copy link

iM-GeeKy commented Jul 4, 2024

@seb-zabielski @gedu Is there a tentative timeline for 5.12.4. Also, random question, but is @lukewalczak no longer maintaining this?

@lukewalczak lukewalczak merged commit eed911b into callstack:main Jul 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants