Open nharlow89 opened 6 years ago
Had to adapt this into a HOC:
import React from 'react';
import TrackVisibility from 'react-on-screen';
export default (Component, visibilityProps = {}) => props => (
<TrackVisibility partialVisibility {...visibilityProps}>
{({ isVisible }) => (
<Component
{...props}
isVisible={isVisible}
/>
)}
</TrackVisibility>
);
I would like to express interest in adding an optional HOC container to this package. Not really an issue necessarily, but I seem to be composing components with one or more HOC these days and it might help this library fit it with common design patterns.