Open
Description
We make heavy use of the following pattern:
export type MyComponentProps = React.ComponentProps<'element'> & {
extraProp: string,
};
We may want to consider migrating these to use an interface
instead:
export interface MyComponentProps extends React.ComponentProps<'element'> {
extraProp: string,
}
See this article on the reason why. The version using &
is slower, especially if there are a lot of props (which there are in these HTML ComponentProps
types).