'Sticky Sidebar In React.js

I tried some packages as well as a jquery solution for the same questiion. (I copied the question because of its good explanation). But I want it in React. Help!!!

Sticky sidebar: stick to bottom when scrolling down, top when scrolling up

  1. Sidebar sits under the header.

  2. As you scroll down the sidebar remains level with the content of the page so that you can scroll through both sidebar and content.

  3. Reach the bottom of the sidebar, the sidebar sticks to the bottom of the viewport (most plugins only allow for sticking to top, some that allow for sticking to bottom don't allow for both).

  4. Reach the bottom, sidebar sits above the footer.

  5. As you scroll back up, the sidebar stays level with the content so you can scroll through the content and sidebar again.

  6. Reach the top of the sidebar, the sidebar sticks to the top of the viewport.

  7. Reach the top and the sidebar sits back below the header.

Here is the link of Original Question : Sticky sidebar: stick to bottom when scrolling down, top when scrolling up



Solution 1:[1]

I was searching for the same and after testing some packages I found react-sticky-box you can see working examples in the link.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Reza Sam