Skip to content

Commit f26e907

Browse files
Merge pull request #5236 from mertJF/fix/types/props-with-children
fix(types): `PropsWithChildren` type argument issue
2 parents 65bcb7e + c7a151e commit f26e907

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/calendar_container.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from "react";
22

3-
export interface CalendarContainerProps extends React.PropsWithChildren {
3+
export interface CalendarContainerProps
4+
extends React.PropsWithChildren<HTMLDivElement> {
45
showTimeSelectOnly?: boolean;
56
showTime?: boolean;
6-
className?: string;
77
}
88

99
const CalendarContainer: React.FC<CalendarContainerProps> = function ({

src/popper_component.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import TabLoop from "./tab_loop";
77
import withFloating from "./with_floating";
88

99
import type { FloatingProps } from "./with_floating";
10+
import type { ReactNode } from "react";
1011

1112
interface PortalProps
1213
extends Omit<React.ComponentPropsWithoutRef<typeof Portal>, "children"> {}
@@ -20,7 +21,7 @@ interface PopperComponentProps
2021
className?: string;
2122
wrapperClassName?: string;
2223
popperComponent: React.ReactNode;
23-
popperContainer?: React.FC<React.PropsWithChildren>;
24+
popperContainer?: React.FC<{ children?: ReactNode | undefined }>;
2425
targetComponent: React.ReactNode;
2526
popperOnKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
2627
showArrow?: boolean;

src/tab_loop.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import React, { Component, createRef } from "react";
22

3-
interface TabLoopProps extends React.PropsWithChildren {
3+
import type { ReactNode } from "react";
4+
5+
interface TabLoopProps {
46
enableTabLoop?: boolean;
7+
children?: ReactNode | undefined;
58
}
69

710
const focusableElementsSelector =

0 commit comments

Comments
 (0)