Composer redesign: Q/A pass (#40452)

This commit is contained in:
Echo
2026-09-10 15:33:34 +00:00
committed by GitHub
parent 629583d449
commit df213ecb1d
21 changed files with 208 additions and 114 deletions

View File

@@ -8,6 +8,8 @@ import type {
ForwardRefExoticComponent,
} from 'react';
import type { DistributedOmit } from 'type-fest';
// This complicated type file is based on the following posts:
// - https://www.tsteele.dev/posts/react-polymorphic-forwardref
// - https://www.kripod.dev/blog/behind-the-as-prop-polymorphism-done-well/
@@ -83,5 +85,8 @@ export type PolymorphicProps<
As extends React.ElementType,
> = {
as?: As;
} & Omit<React.ComponentPropsWithRef<As>, keyof AdditionalProps | 'as'> &
} & DistributedOmit<
React.ComponentPropsWithRef<As>,
keyof AdditionalProps | 'as'
> &
AdditionalProps;