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

[SwipeableDrawer] fixed typescript warning "prop open undefined" #34710

Merged
merged 15 commits into from Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pages/material-ui/api/swipeable-drawer.json
Expand Up @@ -2,7 +2,7 @@
"props": {
"onClose": { "type": { "name": "func" }, "required": true },
"onOpen": { "type": { "name": "func" }, "required": true },
"open": { "type": { "name": "bool" }, "required": true },
"open": { "type": { "name": "bool" } },
"children": { "type": { "name": "node" } },
"disableBackdropTransition": { "type": { "name": "bool" } },
"disableDiscovery": { "type": { "name": "bool" } },
Expand Down
Expand Up @@ -47,6 +47,7 @@ export interface SwipeableDrawerProps extends Omit<DrawerProps, 'onClose' | 'ope
onOpen: React.ReactEventHandler<{}>;
/**
* If `true`, the component is shown.
* @default false
*/
open: boolean;
kraftware marked this conversation as resolved.
Show resolved Hide resolved
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/mui-material/src/SwipeableDrawer/SwipeableDrawer.js
Expand Up @@ -149,7 +149,7 @@ const SwipeableDrawer = React.forwardRef(function SwipeableDrawer(inProps, ref)
ModalProps: { BackdropProps, ...ModalPropsProp } = {},
onClose,
onOpen,
open,
open = false,
PaperProps = {},
SwipeAreaProps,
swipeAreaWidth = 20,
Expand Down Expand Up @@ -655,6 +655,7 @@ SwipeableDrawer.propTypes /* remove-proptypes */ = {
onOpen: PropTypes.func.isRequired,
/**
* If `true`, the component is shown.
* @default false
*/
open: PropTypes.bool.isRequired,
/**
Expand Down