diff --git a/.changeset/lazy-beans-move.md b/.changeset/lazy-beans-move.md new file mode 100644 index 00000000000..06ea4692668 --- /dev/null +++ b/.changeset/lazy-beans-move.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +Update TypeScript types for deprecated ButtonClose to support React 18 diff --git a/src/deprecated/Button/ButtonClose.tsx b/src/deprecated/Button/ButtonClose.tsx index e8ca9b4b1da..ca47928eb3b 100644 --- a/src/deprecated/Button/ButtonClose.tsx +++ b/src/deprecated/Button/ButtonClose.tsx @@ -23,7 +23,13 @@ const StyledButton = styled.button` ${sx}; ` -const ButtonClose = forwardRef>((props, ref) => { +const ButtonClose = forwardRef< + HTMLButtonElement, + // Include {theme?: any} in the intersection as it mirrors the generated type + // from styled-components + // eslint-disable-next-line @typescript-eslint/no-explicit-any + React.ButtonHTMLAttributes & {theme?: any} & SxProp +>((props, ref) => { return (