Repository navigation
chore(dashboard): replace forwardRef with ref as a prop - #5443
Merged
Merged
Conversation
Contributor
Vercel Deployment Info - dashboard
|
robertkasza
force-pushed
the
chore/dashboard-remove-forwardref
branch
from
November 24, 2026 11:22
af53e6f to
7c1caff
Compare
albertomolinafelipe
approved these changes
Nov 24, 2026
dbarrosop
approved these changes
Nov 24, 2026
robertkasza
force-pushed
the
chore/dashboard-remove-forwardref
branch
from
November 24, 2026 14:31
e0241b3 to
0e5c2eb
Compare
React 19 passes ref as a regular prop, so forwardRef is no longer needed. Enable Biome's noReactForwardRef so it doesn't come back, convert the 58 dashboard components that used it, and drop the displayName assignments that only existed because of forwardRef. Radix wrappers are typed with React.ComponentProps, which includes ref, and the generic form components no longer need their forwardRef type casts. Update the JS design rules, which still asked for forwardRef. Checks: biome check, tsc --noEmit, and Vitest on the 20 test files next to the changed components.
robertkasza
force-pushed
the
chore/dashboard-remove-forwardref
branch
from
November 25, 2026 11:02
0e5c2eb to
e691f93
Compare
robertkasza
enabled auto-merge (squash)
November 25, 2026 11:02
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.
React 19 passes
refas a regular prop, soforwardRefisn't needed anymore.noReactForwardRefindashboard/biome.json, so newforwardRefusage fails lint.forwardRefto takerefas a prop. Radix wrappers inui/v3are typed withReact.ComponentProps<typeof Primitive.X>, which includesref; the generic form components (FormInput,FormSelect, …) lose theirforwardRef(...) as <...>casts.displayNameassignments that only existed because offorwardRef. Nothing reads them; the only visible change isReadOnlyToggleshowing under its function name in React DevTools..claude/docs/javascript-design-rules.md, which still asked forforwardRef.landing/still has 4forwardRefuses; they're out of scope here.Checklist
biome check,tsc --noEmit, Vitest on the 20 test files next to the changed components; full suite left to CI)Goal
The dashboard runs on React 19, where function components receive
refas an ordinary prop andReact.forwardRefis deprecated. 58 dashboard components still wrapped themselves inforwardRef, and the JS design rules still told contributors to use it. This branch moves every dashboard component to the React 19 ref-as-prop pattern without changing runtime behavior or public component APIs, and adds a lint rule soforwardRefcannot return.landing/is explicitly out of scope.Type: Refactoring
Changes
dashboard/biome.jsonenables Biome'snoReactForwardRefrule, so any newforwardRefcall in the dashboard failsbiome check.ui/v3) — eachReact.forwardRef<ComponentRef<typeof P>, ComponentPropsWithoutRef<typeof P>>((props, ref) => …)becomes a plain arrow component that destructuresreffromReact.ComponentProps<typeof P>(which already includesref) and forwards it to the primitive.import * as Reactbecomesimport type * as Reactwhere React is now only used for types.FormCheckbox,FormInput,FormPasswordInput,FormSelect,FormSwitchandFormTextareawere inner generic functions wrapped byforwardRef(...)and cast back to a generic signature. They are now the exported generic function itself, takingref?: Ref<…>in props, soTFieldValues/TNameinference works without the cast. Refs are still merged with thereact-hook-formfield ref viamergeRefs.displayNameremoval — assignments that existed only becauseforwardRefreturns an anonymous component are deleted; components now report their variable or function name in React DevTools..claude/docs/javascript-design-rules.mdnow asks forrefas a regular prop and documents typing Radix wrappers withReact.ComponentProps.Key files
dashboard/biome.json(+2/-1) — enablesnoReactForwardRefdashboard/src/components/ui/v3/*(30 files) — Radix/Shadcn wrappers converteddashboard/src/components/form/*(6 files, +134/-206) — generic form components without castsdashboard/src/components/{common,layout,presentational}/*(14 files) — shared components converteddashboard/src/features/orgs/projects/**(9 files) — feature components converted, mostly re-indentation.claude/docs/javascript-design-rules.md(+1/-1) — rule update