Skip to content

fix: resolve race condition crash when rendering multiple DotLottie components#31

Merged
theashraf merged 1 commit intomainfrom
fix/issue-29-multiple-animations-crash
Nov 11, 2025
Merged

fix: resolve race condition crash when rendering multiple DotLottie components#31
theashraf merged 1 commit intomainfrom
fix/issue-29-multiple-animations-crash

Conversation

@theashraf
Copy link
Member

Fixes crash that occurred when multiple DotLottie components were mounted simultaneously in Expo SDK 54 with React 19 and the new architecture.

Root cause: In version 0.7.0, animation initialization was changed from synchronous to asynchronous using DispatchQueue.main.async. When multiple components mounted at the same time, their initialization code would execute concurrently, causing a race condition in the underlying native SDK

Changes:

  • Modified scheduleAnimationUpdate() to execute synchronously
  • Added test case MultipleAnimationsTest to reproduce and verify the fix

fixes #29

@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2025

⚠️ No Changeset found

Latest commit: f8bc281

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@theashraf theashraf force-pushed the fix/issue-29-multiple-animations-crash branch from 5019f39 to f8bc281 Compare November 11, 2025 08:28
@theashraf theashraf merged commit 438e868 into main Nov 11, 2025
7 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.

Crash when rendering multiple <DotLottie /> components (Expo SDK 54, React 19)

2 participants