alvarotrigo / react-fullpage

Official React.js wrapper for fullPage.js https://alvarotrigo.com/react-fullpage/
GNU General Public License v3.0
1.28k stars 179 forks source link

ScrollOverflow not working when I listen to mousemove event. #133

Open tomiiide opened 5 years ago

tomiiide commented 5 years ago

I'm trying to create a cutom cursor by listening to the mousemove event, however for some reason, this breaks ScrollOverflow, I don't know why.

Cursor.js component

componentDidMount(){
    this.loadCursor();
  }

  loadCursor(){
    document.addEventListener("mousemove", e => {
      const clientX = e.clientX;
      const clientY = e.clientY;

      this.setState({
        position: {
          x : clientX,
          y: clientY
        }
      })
    });
  }
alvarotrigo commented 5 years ago

Please provide an isolated reproduction in Codesandbox with no CSS or JS files external to fullPage.js and the minimum amount of HTML code. Use empty sections unless strictly necessary for the reproduction.

Perhaps you might find useful to read my article regarding how to create isolated reproductions.