How to add a ClassName and remove it onScroll event in React.JS?
问题 I'm trying to make a Sticky Header that can change its background-color based on his position on the page. To do that, I'm trying to add a className "active" to my Styled Component "StyledHeader" that will appears when the scrollPositionY is above 400px and disappear when below. In other words, what I want to do is something like this but using React.JS, JSX syntax and Styled Components. Here's what I have for now: import { Link } from '@reach/router'; import DuskLogo from '../images/dusk