Skip to content

Commit

Permalink
[SwipeableDrawer] fixed typescript warning "prop open undefined" (#34710
Browse files Browse the repository at this point in the history
)

Signed-off-by: kraftware <[email protected]>
Co-authored-by: Patrick Kraft <[email protected]>
Co-authored-by: Michał Dudak <[email protected]>
  • Loading branch information
3 people authored Dec 12, 2022
1 parent faefd3e commit 08bf5e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/pages/material-ui/api/swipeable-drawer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"props": {
"onClose": { "type": { "name": "func" }, "required": true },
"onOpen": { "type": { "name": "func" }, "required": true },
"open": { "type": { "name": "bool" }, "required": true },
"children": { "type": { "name": "node" } },
"disableBackdropTransition": { "type": { "name": "bool" } },
"disableDiscovery": { "type": { "name": "bool" } },
Expand All @@ -12,6 +11,7 @@
},
"hysteresis": { "type": { "name": "number" }, "default": "0.52" },
"minFlingVelocity": { "type": { "name": "number" }, "default": "450" },
"open": { "type": { "name": "bool" } },
"SwipeAreaProps": { "type": { "name": "object" } },
"swipeAreaWidth": { "type": { "name": "number" }, "default": "20" },
"transitionDuration": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export interface SwipeableDrawerProps extends Omit<DrawerProps, 'onClose' | 'ope
onOpen: React.ReactEventHandler<{}>;
/**
* If `true`, the component is shown.
* @default false
*/
open: boolean;
open?: boolean;
/**
* The element is used to intercept the touch events on the edge.
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/mui-material/src/SwipeableDrawer/SwipeableDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,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 @@ -669,6 +669,7 @@ SwipeableDrawer.propTypes /* remove-proptypes */ = {
onOpen: PropTypes.func.isRequired,
/**
* If `true`, the component is shown.
* @default false
*/
open: PropTypes.bool.isRequired,
/**
Expand Down

0 comments on commit 08bf5e6

Please sign in to comment.