How to reveal a React component on scroll

后端 未结 4 1599
谎友^
谎友^ 2021-02-04 04:38

I\'ve created a React component for a fixed nav that I would like to remain hidden, until I scroll past a certain point on the page, then slides into view. Medium has a header s

4条回答
  •  孤街浪徒
    2021-02-04 05:02

    You could use a component such as react-headroom to do the heavy lifting for you. Or, you can still use waypoints in React, setting it up in the componentDidMount lifecycle method and removing it using componentWillUnmount.

提交回复
热议问题