fix(react-router): preserve element types in SSR dedupe helper#14860
fix(react-router): preserve element types in SSR dedupe helper#14860grzdev wants to merge 5 commits intoremix-run:mainfrom
Conversation
|
|
Hi @grzdev, Welcome, and thank you for contributing to React Router! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run. Thanks! - The Remix team |
|
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
Added and removed 'grzdev' from contributors list.
Summary
The
dedupehelper inpackages/react-router/lib/dom/ssr/components.tsxcurrently accepts
any[], which erases element types for downstream callers.This change makes
dedupegeneric so it preserves the array element typewhile keeping the same runtime behavior.
Changes
dedupe(array: any[])todedupe<T>(array: readonly T[]): T[]Verification