-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Hi 🙂
Let's say I have a class component decorated by the Watch HOC and I only want to use enterViewport and leaveViewport props from outside this component.
My component re-render each-time one of this props change when I don't even use them :
"isBelowViewport"
"isInViewport"
"isAboveViewport"
"isFullyInViewport"
"lockWatcher"
"unlockWatcher"
"startWatcher"
"stopWatcher"
"enterViewport"
"exitViewport"
"onApplicationAdded"
The main idea is to have a way to replace this : https://github.com/stutrek/scrollmonitor-react/blob/master/index.js#L159 by something like :
const omitInternalProps = obj => require('lodash.omit')(obj, [
'autoStart',
'innerRef',
'stateChange',
'visibilityChange',
'enterViewport',
'fullyEnterViewport',
'exitViewport',
'partiallyExitViewport',
]);
return (
<Component {...omitInternalProps(this.props))}>
{this.props.children}
</Component>
);@stutrek what do you think ? Did I miss something ? 🤔
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels