Skip to content

Commit 6e230d1

Browse files
committed
fix(dialog): improve code completion with props
1 parent 3fde938 commit 6e230d1

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/dialog/Dialog.jsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ export function Dialog({ children, ...props }) {
2020
}
2121

2222
Dialog.propTypes = {
23-
content: PropTypes.any,
24-
children: PropTypes.any,
23+
children: PropTypes.node,
24+
body: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
25+
centered: PropTypes.bool,
26+
footer: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
27+
keyboard: PropTypes.bool,
28+
scrollable: PropTypes.bool,
29+
size: PropTypes.oneOf(['sm', 'lg', 'xl', '']),
30+
staticBackdrop: PropTypes.bool,
31+
title: PropTypes.node,
2532
};
2633

2734
function DialogTrigger({ children, open }) {

src/dialog/Modal.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ Modal.defaultProps = {
8181
};
8282

8383
Modal.propTypes = {
84-
body: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
84+
body: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
8585
centered: PropTypes.bool,
86-
footer: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
86+
footer: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
8787
isOpen: PropTypes.bool,
8888
keyboard: PropTypes.bool,
8989
onClose: PropTypes.func,
9090
scrollable: PropTypes.bool,
9191
size: PropTypes.oneOf(['sm', 'lg', 'xl', '']),
9292
staticBackdrop: PropTypes.bool,
93-
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
93+
title: PropTypes.node,
9494
};
9595

9696
function hideModal(modalRef) {

0 commit comments

Comments
 (0)