Skip to content

Commit 5d3e989

Browse files
committed
Components: Narrow generic type on polymorphic intrinsic types
See: #80705 (comment) Since this can cascade to inner types like event handler props, we can do better than the loose `any` type as we know this will be an element.
1 parent 85789d2 commit 5d3e989

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/components/src/context/wordpress-component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type * as React from 'react';
1010
* contributed to high memory usage and slow compilation times.
1111
*/
1212
type PolymorphicIntrinsicProps = Omit<
13-
React.AllHTMLAttributes< any > & React.SVGAttributes< any >,
13+
React.AllHTMLAttributes< Element > & React.SVGAttributes< Element >,
1414
'as' | 'children'
1515
>;
1616

0 commit comments

Comments
 (0)