Skip to content

Remove invalid forwardRef from preview directory table row#3018

Merged
sawka merged 3 commits intomainfrom
copilot/fix-forwardref-usage-issue
Mar 9, 2026
Merged

Remove invalid forwardRef from preview directory table row#3018
sawka merged 3 commits intomainfrom
copilot/fix-forwardref-usage-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

Wave was emitting React’s forwardRef render functions accept exactly two parameters warning on startup with no useful stack trace. The warning came from the preview directory row component being wrapped in React.forwardRef even though it neither accepted nor used a forwarded ref.

  • Root cause

    • frontend/app/view/preview/preview-directory.tsx defined TableRow with React.forwardRef(...), but the render function was effectively a plain props-only component.
  • Change

    • Removed the unnecessary forwardRef wrapper from TableRow.
    • Kept the component behavior unchanged; it still uses its internal drag ref wiring for DnD.
  • Impact

    • Eliminates the startup warning.
    • Aligns the component definition with its actual usage: callers render TableRow as a normal component and do not pass refs.
// before
const TableRow = React.forwardRef(function ({ row, idx, ...props }: TableRowProps) {
    return <div ref={dragRef}>...</div>;
});

// after
function TableRow({ row, idx, ...props }: TableRowProps) {
    return <div ref={dragRef}>...</div>;
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 9, 2026

Deploying waveterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 18c8bda
Status: ✅  Deploy successful!
Preview URL: https://398d694e.waveterm.pages.dev
Branch Preview URL: https://copilot-fix-forwardref-usage.waveterm.pages.dev

View logs

Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix forwardRef render parameter issues in components Remove invalid forwardRef from preview directory table row Mar 9, 2026
Copilot finished work on behalf of sawka March 9, 2026 22:04
@sawka sawka marked this pull request as ready for review March 9, 2026 22:58
@sawka sawka merged commit 39b68fb into main Mar 9, 2026
7 checks passed
@sawka sawka deleted the copilot/fix-forwardref-usage-issue branch March 9, 2026 23:04
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.

2 participants