Skip to content

Commit

Permalink
Merge pull request #135 from element-hq/more-react-17
Browse files Browse the repository at this point in the history
Change types some more for React 17 compatibility
  • Loading branch information
robintown authored Dec 13, 2023
2 parents 6ffa277 + 8e5db75 commit 09a2bcf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Menu/DrawerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface Props extends ComponentPropsWithoutRef<"div"> {
// This an internal component not intended for export! Consumers should use it
// via the Menu or ContextMenu components.
export const DrawerMenu = forwardRef<HTMLDivElement, Props>(
({ title, children, className, ...props }, ref): ReactNode => (
({ title, children, className, ...props }, ref) => (
<div
ref={ref}
className={classNames(className, styles.drawer)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menu/FloatingMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface Props extends ComponentPropsWithoutRef<"div"> {
// This an internal component not intended for export! Consumers should use it
// via the Menu or ContextMenu components.
export const FloatingMenu = forwardRef<HTMLDivElement, Props>(
({ title, className, children, ...props }, ref): ReactNode => {
({ title, className, children, ...props }, ref) => {
const titleId = useId();
return (
<div
Expand Down
3 changes: 1 addition & 2 deletions src/components/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import React, {
ComponentPropsWithoutRef,
ComponentType,
ElementType,
ReactNode,
SVGAttributes,
useCallback,
useContext,
Expand Down Expand Up @@ -80,7 +79,7 @@ export const MenuItem = <C extends MenuItemElement = "button">({
onClick: onClickProp,
disabled,
...props
}: Props<C>): Exclude<ReactNode, undefined> => {
}: Props<C>): JSX.Element => {
const Component = as ?? ("button" as ElementType);
const context = useContext(MenuContext);

Expand Down

0 comments on commit 09a2bcf

Please sign in to comment.