Skip to content

Commit 12a345c

Browse files
committed
fix(button & dropdownitem): reverts return type of Button & DropdownItem to JSX.Element
In themesberg#1244, the return type of Button and DropdownItem was changed to ReactNode. This is not an acceptable return type for functional components. The correct return type is JSX.Element. This change fixes the regression from that PR (introduced in v v0.7.3 A Also fixes themesberg#962. fix themesberg#962
1 parent 31c9d9d commit 12a345c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/Button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export type ButtonProps<T extends ElementType = 'button'> = PolymorphicComponent
9090

9191
type ButtonComponentType = (<C extends React.ElementType = 'button'>(
9292
props: ButtonProps<C>,
93-
) => React.ReactNode | null) & { displayName?: string };
93+
) => JSX.Element | null) & { displayName?: string };
9494

9595
const ButtonComponentFn: ButtonComponentType = forwardRef(
9696
<T extends ElementType = 'button'>(

src/components/Dropdown/DropdownItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type DropdownItemProps<T extends ElementType = 'button'> = PolymorphicCom
2727

2828
type DropdownItemComponentType = (<C extends React.ElementType = 'button'>(
2929
props: DropdownItemProps<C>,
30-
) => React.ReactNode | null) & { displayName?: string };
30+
) => JSX.Element | null) & { displayName?: string };
3131

3232
export const DropdownItem: DropdownItemComponentType = forwardRef(
3333
<T extends ElementType = 'button'>(

0 commit comments

Comments
 (0)