mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
delete util import
This commit is contained in:
parent
306389273a
commit
68da7f2078
@ -1,6 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import RcDrawer from 'rc-drawer';
|
||||
import { isNull, isNumber } from 'util';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
type EventType =
|
||||
@ -60,7 +59,7 @@ export default class Drawer extends React.Component<
|
||||
prevState: IDrawerState,
|
||||
) {
|
||||
const nextState: IDrawerState = {};
|
||||
if (!isNull(nextProps.visible) && nextProps.visible !== prevState.visible) {
|
||||
if (nextProps.visible !== null && nextProps.visible !== prevState.visible) {
|
||||
nextState.visible = nextProps.visible;
|
||||
}
|
||||
return nextState;
|
||||
@ -72,7 +71,7 @@ export default class Drawer extends React.Component<
|
||||
};
|
||||
}
|
||||
close = (e: EventType) => {
|
||||
if (!isNull(this.props.visible)) {
|
||||
if (this.props.visible !== null) {
|
||||
if (this.props.onClose) {
|
||||
this.props.onClose(e);
|
||||
}
|
||||
@ -126,7 +125,7 @@ export default class Drawer extends React.Component<
|
||||
}
|
||||
render() {
|
||||
let { width, zIndex, style, ...rest } = this.props;
|
||||
if (isNumber(width)) {
|
||||
if (typeof width === 'number') {
|
||||
width = `${width}px`;
|
||||
}
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user