mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-08 14:47:12 +02:00
refactor(v2): toggleResponsiveSidebar => more stable callback (#4626)
This commit is contained in:
parent
42d02369d8
commit
38a1003233
1 changed files with 2 additions and 2 deletions
|
@ -227,8 +227,8 @@ function useResponsiveSidebar() {
|
|||
);
|
||||
|
||||
const toggleResponsiveSidebar = useCallback(() => {
|
||||
setShowResponsiveSidebar(!showResponsiveSidebar);
|
||||
}, [setShowResponsiveSidebar, showResponsiveSidebar]);
|
||||
setShowResponsiveSidebar((value) => !value);
|
||||
}, [setShowResponsiveSidebar]);
|
||||
|
||||
return {
|
||||
showResponsiveSidebar,
|
||||
|
|
Loading…
Add table
Reference in a new issue