Thanks for your help.
Any tips for getting this to work well with React? This codepen is actually being used on a Gatsby project.
It works on the first load of the homepage. But if I go to about, then back home it has the same issue. https://share.getcloudapp.com/4gulZ8GP