• Dan CortesDan Cortes, over 7 years ago

    Keep in mind that, by default, React rerenders your component on state change, so keeping track of mouseX and mouseY in state could get expensive. I would recommend combining your onMouseMove and CreateShadow functions and skipping the setting of state entirely since you're really only using it to track the mouse position which you're already getting with e.pageX and e.pageY.

    0 points
  • Bryant HughesBryant Hughes, over 7 years ago

    Any background on why you wanted to use React for this? Was there a specific benefit as opposed to just using vanilla JS?

    0 points