Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix PopupProps type error #319

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface PopupProps {
nested?: boolean;
defaultOpen?: boolean;
on?: EventType | EventType[];
children: React.ReactNode;
children: React.ReactNode | ((close: () => void, isClose?: boolean) => React.ReactNode);
Copy link

@DerPipo DerPipo Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
children: React.ReactNode | ((close: () => void, isClose?: boolean) => React.ReactNode);
children: React.ReactNode | ((close: () => void, isOpen: boolean) => React.ReactNode);

Shouldn't it be called isOpen (instead of isClose)? And as you can see in line 306, the second param is always provided and cannot be undefined, so the ? is unnecessary.

But otherwise the changes look good and should get merged.


//| ((close: () => void, isOpen: boolean) => React.ReactNode);
position?: PopupPosition | PopupPosition[];
Expand Down