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 45efec9 commit 78494e5Copy full SHA for 78494e5
1 file changed
src/components/SidebarMobile/SidebarMobile.jsx
@@ -18,9 +18,24 @@ export default class SidebarMobile extends Component {
18
sections: PropTypes.array,
19
};
20
21
+ componentDidMount() {
22
+ if (this.props.isOpen) {
23
+ this._toggleBodyListener(true);
24
+ }
25
26
+
27
+ componentDidUpdate(prevProps) {
28
+ if (prevProps.isOpen !== this.props.isOpen) {
29
+ this._toggleBodyListener(this.props.isOpen);
30
31
32
33
+ componentWillUnmount() {
34
+ this._toggleBodyListener(false);
35
36
37
render() {
38
const { isOpen, toggle } = this.props;
- this._toggleBodyListener(isOpen);
39
40
return (
41
<nav
0 commit comments