fix: unify @types/react versions across workspace#3020
Open
StarbirdTech wants to merge 1 commit intospacedriveapp:mainfrom
Open
fix: unify @types/react versions across workspace#3020StarbirdTech wants to merge 1 commit intospacedriveapp:mainfrom
StarbirdTech wants to merge 1 commit intospacedriveapp:mainfrom
Conversation
Replace outdated `npm:types-react@rc` aliases (19.0.0-rc.1) with stable `~19.1.10` in packages/interface, packages/ui, and apps/tauri. Also pin apps/web from the loose `^19.0.0` to `~19.1.10`. This eliminates four duplicate copies of @types/react that caused ~100 false-positive JSX component errors. Add vite-env.d.ts with an SVG module declaration extending vite/client with the SVGR ReactComponent export used by packages/assets. Reduces typecheck errors from ~1,221 to ~428 (all remaining are real project-level issues). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| import type { FC, SVGProps } from 'react'; | ||
| const src: string; | ||
| export default src; | ||
| export const ReactComponent: FC<SVGProps<SVGSVGElement>>; |
Contributor
There was a problem hiding this comment.
This matches common SVGR typings, but you may want to include the optional title prop to avoid needless friction when callers pass it.
Suggested change
| export const ReactComponent: FC<SVGProps<SVGSVGElement>>; | |
| export const ReactComponent: FC<SVGProps<SVGSVGElement> & { title?: string }>; |
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.
The
npm:types-react@rcaliases from the React 19 RC phase and loose^19.0.0ranges were still in four frontend packages. PR #3011 added@types/react: ~19.1.10to rootdevDependenciesandoverrides, but explicit childdevDependenciestake precedence — so four copies coexisted (19.0.0-rc.1 and 19.1.17), and TypeScript treated theirReactNodetypes as incompatible. Also adds avite-env.d.tsthat bringsvite/clienttype declarations (.png,.svg,.ogg,.mp3, etc.) into the tauri typecheck scope and declares theReactComponentSVG export that SVGR expects.Changes
apps/tauri,packages/interface,packages/ui— replacenpm:types-react@rcaliases with~19.1.10apps/web— replace^19.0.0range with~19.1.10apps/tauri/src/vite-env.d.ts— referencesvite/clientfor asset module types and adds theReactComponentnamed export for*.svg(SVGR convention thatvite/clientdoesn't cover)bun.lockb— regenerated, 37KB smaller with deduplicationImpact
Typecheck errors: 1,119 → 428 (~62% reduction). All 1,119 errors were pre-existing on main — ~687 were missing asset module declarations (
.png,.svg, etc.) now resolved by thevite/clientreference, and the rest were duplicate-@types/reactfallout. The remaining 428 are real project-level issues (unused vars,TailwindFactorytypes, broken imports).Verified
@types/react@19.1.17copy at root; zero nested copiesapps/webbuild failure unchanged (unrelated@sd/interface/platformexport)