You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 24a8fb3
Browse filesBrowse the repository at this point in the historyBrowse files
Merge PR #809: fix partial/undefined props under React 18 TypeScript
Fixes#807. Making the propTypes static optional keeps it out of the required public type surface. React <= 18's JSX LibraryManagedAttributes only consults propTypes when it is a required member; when it does, the index-signature propTypes cancels defaultProps optionality and consumers must pass every prop. React 19 ignores propTypes entirely, so v19 alone could not catch this.
Adds typings/tsconfig.react18.json, wired into make lint, which type-checks the public surface against @types/react@18 so the regression cannot return.
The PR's yarn.lock was dropped and regenerated on top of master: it had been rebuilt against a different registry and lost all 49 platform-optional esbuild/rollup binaries, which would break yarn install --frozen-lockfile on Linux CI.
Co-authored-by: Josh Kelley <joshkel@gmail.com>
"//": "Type-checks the public API against @types/react@18 as well as the default v19. React 18's JSX `LibraryManagedAttributes` consults a component's `propTypes`, unlike v19 which ignores it. A `propTypes` member leaking into the public types there makes `defaultProps` stop marking props optional, so React 18 consumers must pass every prop. v19 alone cannot catch that regression. Only `react` is redirected to the v18 types; `react-dom` stays on its installed v19 types (skipLibCheck ignores any v18/v19 mismatch inside its .d.ts). Aliasing react-dom too would pull in an `@types/react-dom-18` whose `@types/react@^18` peer cannot be satisfied under npm's strict resolution.",
0 commit comments