Skip to content

v0.11.0

Compare
Choose a tag to compare
@coreyward coreyward released this 19 Nov 21:49
· 23 commits to master since this release
e3e9764

This release adds two additional configuration directives that augment the way SanityImage handles alt props.

  1. warnOnMissingAlt — when a SanityImage component is rendered without an alt 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.
  2. emptyAltFallback — when no alt 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 an alt 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.”