Skip to content

Commit 084c3b8

Browse files
committed
refactor(COffcanvas): improve syntax
1 parent 6a8d1b4 commit 084c3b8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/coreui-react/src/components/offcanvas/COffcanvas.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,9 @@ export const COffcanvas = forwardRef<HTMLDivElement, COffcanvasProps>(
8080
}, [visible])
8181

8282
useEffect(() => {
83-
if (_visible) {
84-
if (!scroll) {
85-
document.body.style.overflow = 'hidden'
86-
document.body.style.paddingRight = '0px'
87-
}
83+
if (_visible && !scroll) {
84+
document.body.style.overflow = 'hidden'
85+
document.body.style.paddingRight = '0px'
8886
return
8987
}
9088

0 commit comments

Comments
 (0)