Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
fix: pass props through InnerBodyScrollLock component (#88)
Browse files Browse the repository at this point in the history
* fix: pass props through InnerBodyScrollLock component

* refactor: rename `rest` props to `otherProps`
  • Loading branch information
humancatfood authored May 27, 2020
1 parent da3c8ad commit 7461459
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Modal/BodyScrollLock.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function useScrollLockStyles({isLocked}) {
}

function InnerBodyScrollLock(props, ref) {
const {as: Component = 'div', children, style} = props;
const {as: Component = 'div', children, style, ...otherProps} = props;
const modalStack = useContext(ModalStackContext);
const hasModal = modalStack?.length;
const bodyLockStyles = useScrollLockStyles({isLocked: hasModal});
Expand All @@ -44,6 +44,7 @@ function InnerBodyScrollLock(props, ref) {
<Component
ref={ref}
style={style ? {...style, ...bodyLockStyles} : bodyLockStyles}
{...otherProps}
>
{children}
</Component>
Expand Down

0 comments on commit 7461459

Please sign in to comment.