Skip to content

Commit

Permalink
Drawer default prop warning fix (#3382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ackos95 authored and adidahiya committed Feb 27, 2019
1 parent f7d08a9 commit b3c5c1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/components/drawer/drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export class Drawer extends AbstractPureComponent<IDrawerProps, {}> {
public static displayName = `${DISPLAYNAME_PREFIX}.Drawer`;
public static defaultProps: IDrawerProps = {
canOutsideClickClose: true,
isCloseButtonShown: true,
isOpen: false,
style: {},
vertical: false,
Expand Down Expand Up @@ -115,7 +114,9 @@ export class Drawer extends AbstractPureComponent<IDrawerProps, {}> {
}

private maybeRenderCloseButton() {
if (this.props.isCloseButtonShown) {
// `isCloseButtonShown` can't be defaulted through default props because of props validation
// so this check actually defaults it to true (fails only if directly set to false)
if (this.props.isCloseButtonShown !== false) {
return (
<Button
aria-label="Close"
Expand Down

1 comment on commit b3c5c1f

@blueprint-bot
Copy link

Choose a reason for hiding this comment

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

Drawer default prop warning fix (#3382)

Previews: documentation | landing | table

Please sign in to comment.