Drawer `onRequestChange` function prop is not called
See original GitHub issueProblem description
Using Drawer component, onRequestChange
function is not called.
The non working code should be working, don’t know what is going on with this component.
Non working code
onDrawerStatusChange() {
console.log('Drawer status changed');
}
render() {
return (
<Drawer onRequestChange={this.onDrawerStatusChange} />
);
}
Regardless the previous code, the following examples are working fine.
Working code
onDrawerStatusChange() {
console.log('Drawer status changed');
}
render() {
return (
<div>
<Drawer onRequestChange={console.log('Drawer status changed')} />
<Drawer onRequestChange={this.onDrawerStatusChange()} />
</ div>
);
}
Versions
- Material-UI: 0.18.5
- React: 15.6.1
- Browser: Chrome 59
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Drawer onRequestChange function prop is not called #7322
Problem description Using Drawer component, onRequestChange function is not called. The non working code should be working, don't know what ...
Read more >Material-UI Drawer will not close and chrome shows a Warning
in components/LeftDrawer but instead i get a warning in chrome which reads: Warning: Unknown prop `onRequestChange` on <div> tag. Remove this ...
Read more >Components and Props - React
Such functions are called “pure” because they do not attempt to change their inputs, and always return the same result for the same...
Read more >Navigation prop reference
In a native stack navigator, calling navigate with a screen name will result in different behavior based on if the screen is already...
Read more >useDisclosure - Chakra UI
Callback function to retrieve a set of props for the button that triggers the disclosure. Usage#. You can use a combination of the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m fine with this and I was just pointing out how I managed to get
onRequestChange
to fireI’ve noticed that
onRequestChange
is called only ifdocked
property is set to false