Skip to content

Conversation

@ibrahimcesar
Copy link
Owner

No description provided.

This commit addresses several critical issues found during code review:

1. Fixed missing useEffect dependencies:
   - Added onIframeAdded to useEffect deps in index.tsx
   - Wrapped onIframeAdded in useCallback to prevent unnecessary re-renders
   - Added vi, format, imageRes deps to useEffect in useYoutubeThumbnail.tsx

2. Fixed conflicting cookie logic:
   - Removed redundant noCookie prop assignment that was being overwritten
   - Simplified to use only cookie prop for determining YouTube domain
   - Added @deprecated JSDoc annotation to noCookie prop

3. Replaced deprecated frameBorder attribute:
   - Removed frameBorder="0" from iframe element
   - Added style={{ border: 0 }} to comply with React standards

All tests passing (20/20).
Resolved conflicts between accessibility improvements (focusOnLoad) and
critical bug fixes (hook dependencies). The resolution preserves both:

- Props params parsing logic for custom YouTube parameters
- Complete useEffect dependency array including focusOnLoad and ref
- All memoization optimizations from both branches

Changes merged from claude/fix-critical-bugs branch:
- Fixed useEffect dependencies in useYoutubeThumbnail hook
- Wrapped onIframeAdded in useCallback with proper dependencies
- Replaced deprecated frameBorder with style={{ border: 0 }}

All 20 tests passing ✅
@ibrahimcesar ibrahimcesar merged commit af79db2 into main Nov 14, 2025
1 check was pending
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.

3 participants