From eddb4f4ab37c2d60ba93ece00298c5f99a6d77ff Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 6 Dec 2022 12:51:38 -0600 Subject: [PATCH 1/3] fix(ButtonClose): update types for React 18 --- src/deprecated/Button/ButtonClose.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/deprecated/Button/ButtonClose.tsx b/src/deprecated/Button/ButtonClose.tsx index e8ca9b4b1da..8f3e2b05123 100644 --- a/src/deprecated/Button/ButtonClose.tsx +++ b/src/deprecated/Button/ButtonClose.tsx @@ -23,7 +23,10 @@ const StyledButton = styled.button` ${sx}; ` -const ButtonClose = forwardRef>((props, ref) => { +const ButtonClose = forwardRef< + HTMLButtonElement, + React.ButtonHTMLAttributes & {theme?: any} & SxProp +>((props, ref) => { return ( From a959fbaf2302bcb53ce4b0db126cb8f8a22c3c34 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 6 Dec 2022 12:51:55 -0600 Subject: [PATCH 2/3] chore: add changeset --- .changeset/lazy-beans-move.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/lazy-beans-move.md 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 From f5dc10975fb53b315d6bc18cd1abc697660d8525 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 13 Dec 2022 12:11:20 -0600 Subject: [PATCH 3/3] chore: add lint ignore --- src/deprecated/Button/ButtonClose.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/deprecated/Button/ButtonClose.tsx b/src/deprecated/Button/ButtonClose.tsx index 8f3e2b05123..ca47928eb3b 100644 --- a/src/deprecated/Button/ButtonClose.tsx +++ b/src/deprecated/Button/ButtonClose.tsx @@ -25,6 +25,9 @@ const StyledButton = styled.button` 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 (