If you access this website, you'll see letters gravitating around the cursor:
This script is not mine. I picked it from the internet and it works like a charm. I'm now trying to understand it and format it for a react application.
What I've done so far: cleaned the code and breakdown this code into functions. I also tested the mouseEvent, it works as expected. I think the problem comes therefore from initialising the main function as well as the eventListener.
Here's a codesandbox: https://codesandbox.io/embed/nostalgic-cherry-i2qtx?fontsize=14&hidenavigation=1&theme=dark
Thanks so much in advance.