How to Load an Image Using the Original File Name
const gatsbyImageData = imageUrlsAndFilesNames[domNode.attribs.src].gatsbyImageData
return (
<GatsbyImage image={gatsbyImageData} className={domNode.attribs.class} alt={domNode.attribs.alt} />
)Was this answer helpful?
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.