v0.11.0
This release adds two additional configuration directives that augment the way SanityImage
handles alt
props.
warnOnMissingAlt
— when aSanityImage
component is rendered without analt
prop, show a warning in the dev console. This is enabled by default in development and disabled in production, but can be either enabled or disabled here as needed.emptyAltFallback
— when noalt
prop is available,SanityImage
can now fall back to setting an empty string value. This can prevent accessibility audits from detecting images that should have analt
value, so this is disabled by default.
There is also now a more helpful error message when no asset
prop is provided. This should prevent confusion with errors about “accessing metadata on undefined.”