SanityImage Component Approach #218
Unanswered
markbebbington
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team! I'm coming from a WordPress background and getting up to speed with Sanity + Next.js image optimization. The Turbo Start template has been fantastic to learn from and I'm using it on a new project, but I have a few questions to help me understand the approach better.
Questions
Manual hotspot/crop handling: I noticed the wrapper extracts
hotspot
andcrop
data to pass to thesanity-image
library. Since the library can get this data directly from the image ID, I'm curious about the thinking behind handling this at the application level?Next.js Image integration: Since
sanity-image
renders a regular<img>
tag, was there consideration for using Next.js Image component instead for additional optimizations?Cost considerations: For responsive layouts like blog cards (1 per row on mobile, 2 per row on tablet, 3 per row on desktop), I really only need a few specific image sizes. Since the
sanity-image
library generates multiple srcSet sizes automatically, I'm wondering about controlling transformation costs at scale - any strategies for ensuring I'm only creating the transforms I actually need?Thanks for any insights!
Beta Was this translation helpful? Give feedback.
All reactions