react-sticky icon indicating copy to clipboard operation
react-sticky copied to clipboard

Support for React Hooks

Open jEnbuska opened this issue 6 years ago • 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>
   )
}

jEnbuska avatar Mar 14 '19 08:03 jEnbuska

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.

vcarl avatar Apr 22 '19 18:04 vcarl