captivationsoftware/react-sticky

Support for React Hooks

Opened this issue · 1 comments

Would it be technically possible for this library to support hooks?

Example usage:

const MyStickyComponent = () => {   
   const {ref, style} = useSticky({top: 0, left: 0});
   return (
      <div ref={ref} style={style}>
         {/* ... */}
      </div>
   )
}
vcarl commented

This would be a dramatically new API, it's possible on a technical level but it'd be a significant change. There would still need to be a StickyContainer somewhere in the render tree, as well.