Toggle Class based on scroll React JS
问题 I'm using bootstrap 4 nav bar and would like to change the background color after ig 400px down scroll down. I was looking at the react docs and found a onScroll but couldn't find that much info on it. So far I have... I don't know if I'm using the right event listener or how to set the height etc. And I'm not really setting inline styles... import React, { Component } from 'react'; class App extends Component { constructor(props) { super(props); this.state = { scrollBackground: 'nav-bg' };