Skip to content

fix(react): guard media store fallback ref - #1813

Merged
mihar-22 merged 1 commit into
mainfrom
codex/1698-media-store-ref-fallback
May 26, 2026
Merged

fix(react): guard media store fallback ref#1813
mihar-22 merged 1 commit into
mainfrom
codex/1698-media-store-ref-fallback

Conversation

@mihar-22

Copy link
Copy Markdown
Member

Summary

  • Guard useMediaStore(playerRef) against a mounted player ref whose $state is temporarily nullish.
  • Fall back to the media context state or initial media store, matching the defensive useMediaState behavior.

Fixes #1698.

Validation

  • pnpm --filter @vidstack/react typecheck

Tests

  • No focused hook test was added because @vidstack/react does not currently have a test script or existing React hook test pattern in this repo.

@mihar-22
mihar-22 marked this pull request as ready for review May 26, 2026 06:51
@mihar-22
mihar-22 merged commit 77b740f into main May 26, 2026
1 check passed
@mihar-22
mihar-22 deleted the codex/1698-media-store-ref-fallback branch May 26, 2026 06:52
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.

Cannot use 'in' operator to search for 'playing' in null

1 participant