Repository navigation
Conversation
The end of the expand animation set React state from Reanimated's completion callback, outside act, so expanding an accordion in a test logged an act warning. The expanded layout (auto height, no clipping) is now applied on the UI thread when the animation reaches its end; only a finished collapse still updates state, to unmount the content.
|
Found potential problems with the pull request:
|
Doberjohn
reviewed
Dec 4, 2026
Collaborator
There was a problem hiding this comment.
Two things before I approve:
- Which platforms did you run the test plan on?
overflowandpositionnow switch inside the animated style instead of a regular style, so a quick run on Android, iOS and web would cover the switch at the end of an expand, and the quick double taps. - As your description says, a collapse that ends outside
actstill logs the warning, since the content unmounts when the collapse ends. Before the accordion animated, a collapse in a test logged nothing, so that half is still open. I'm fine with handling it in a follow-up. If you see a way to keep that state update out of the animation's end as well, it can go here.
Contributor
Author
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
When an expanding
List.Accordionfinished its animation in a Jest test, React logged "An update to List.Accordion inside a test was not wrapped in act(...)", failing setups that fail onconsole.error. Finishing an expand no longer updates the accordion's state, so expanding logs nothing.Related issue
Fixes #5341
Screenshots / Videos
n/a: the accordion looks the same.
Test plan
In the example app, open List.Accordion:
Known limitation: a collapse that ends outside
actstill logs the warning, since the content unmounts after the animation (inList.AccordionGrouptoo).