Skip to content

fix(macos): animated images (GIF) freeze on first frame - #3168

Merged
Saad Najmi (Saadnajmi) merged 1 commit into
microsoft:mainfrom
alicenoknow:fix/macos-animated-gif-display-link
Nov 17, 2026
Merged

Saad Najmi (Saadnajmi) merged 1 commit into
microsoft:mainfrom
alicenoknow:fix/macos-animated-gif-display-link

Conversation

@alicenoknow

Copy link
Copy Markdown

Summary:

Fixes #3165.

On macOS, animated GIFs in <Image> show only their first frame.

RCTUIImageViewAnimated gets its display link from +[RCTDisplayWeakRefreshable displayLinkWithWeakRefreshable:],
which makes a weak proxy the link's target. On iOS that is needed because CADisplayLink retains its target. On macOS,
RCTPlatformDisplayLink holds its target weakly, so nothing owns the proxy. It is freed as soon as the method
returns, and the link's ticks go to nil.

Fix: on macOS, make the view itself the link's target. The link already holds it weakly, so there is no retain
cycle. iOS is unchanged.

Testing:

RNTester (macOS, Fabric) → Image → Animated GIF. On main that example is hidden by an RNTester bug that #3164 fixes.

before-after.mp4
  • Before: the GIF stays on its first frame. After: it animates.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@alicenoknow
Alicja Niewiadomska (alicenoknow) force-pushed the fix/macos-animated-gif-display-link branch from 7c40486 to bef4510 Compare November 5, 2026 13:00
@Saadnajmi
Saad Najmi (Saadnajmi) enabled auto-merge (squash) November 17, 2026 06:35
@Saadnajmi
Saad Najmi (Saadnajmi) merged commit 3ea1b38 into microsoft:main Nov 17, 2026
28 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.

Animated GIFs only show their first frame on macOS

2 participants