We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e43d376 commit 7981902Copy full SHA for 7981902
packages/core/src/Drawer/index.tsx
@@ -8,6 +8,7 @@ import {
8
Dimensions,
9
GestureResponderEvent,
10
} from 'react-native';
11
+import { debounce } from 'lodash';
12
13
const DEVICE_WIDTH = Dimensions.get('window').width;
14
const DEVICE_HEIGHT = Dimensions.get('window').height;
@@ -53,9 +54,10 @@ export default class Drawer extends Component<DrawerProps, DrawerState> {
53
54
isOpen: !!props.isOpen,
55
};
56
}
- handleDrawer = (isOpen: boolean) => {
57
+ handleDrawer = debounce((isOpen: boolean) => {
58
isOpen ? this.openDrawer() : this.closeDrawer();
- };
59
+ }, 100);
60
+
61
componentDidUpdate(prevProps: DrawerProps, prevState: DrawerState) {
62
if (prevState.isOpen !== this.state.isOpen) {
63
this.handleDrawer(this.state.isOpen);
0 commit comments