Thank you, Jack. I'll need to get up to speed on how to use CodePen with React/Gatsby. For now, I've simply wrapped my <StaticImage> in another div and referenced that element like so:
import React, { useEffect, useRef } from "react"
import { StaticImage } from "gatsby-plugin-image"
import { gsap } from 'gsap';
export default function Hero() {
let logo = useRef(null);
useEffect(() => {
let tl = gsap.timeline({ defaults: {opacity: 0, delay: 0.5} });
tl.from(logo.current, {x:-100});
})
return (
<main>
<div ref={logo}>
<StaticImage
src="../images/logo.png"
width={500}
alt="Hero Image"
/>
</div>
</main>
)
}
I edited my original post to reflect this as it may help another. I'm new here, so if I should do something differently, please let me know. Cheers!