Verify and apply PR #20: Add forwardRef to Video component#21
Closed
Verify and apply PR #20: Add forwardRef to Video component#21
Conversation
Co-authored-by: imagekitio <45416977+imagekitio@users.noreply.github.com>
…n guide Co-authored-by: imagekitio <45416977+imagekitio@users.noreply.github.com>
Co-authored-by: imagekitio <45416977+imagekitio@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Verify changes in PR #20 for accuracy
Verify and apply PR #20: Add forwardRef to Video component
Jan 28, 2026
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.
PR #20 adds
forwardRefto the Video component, enabling programmatic control via refs. The maintainer raised a valid concern about React 19 deprecatingforwardRef.Changes
Video Component (
src/components/Video.tsx)forwardRef<HTMLVideoElement, IKVideoProps><video>element (placed after spread operator for proper precedence)displayNamefor debuggingUsage:
Documentation
REACT_19_MIGRATION.md: Explains whyforwardRefis required for React 18, React 19's deprecation timeline, and migration strategiesPR_20_VERIFICATION_SUMMARY.md: Complete analysis including type safety verification, comparison with Image component approach, and recommendation to mergeDeprecation Analysis
Current: Library targets React 18 (
@types/react: ^18.3.3)React 18:
forwardRefis required—function components cannot receive refs directlyReact 19:
forwardRefis deprecated but remains functional for backward compatibilityThe implementation is correct for React 18. Migration to React 19's ref-as-prop pattern can be handled when the library adds React 19 support, either by:
forwardReffor backward compatibility ("react": "^18.0.0 || ^19.0.0")Type Safety
Generated type correctly shows ref support:
Note: The Image component doesn't use
forwardRefbecause it wraps Next.js's<NextImage>, which handles ref forwarding internally. Video wraps a native HTML element, requiring explicitforwardRef.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.