You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the transformed localFile cannot be found, the original image is used.
If the passed image is null|undefined, a placeholder image will be used.
Setup
1. Install
npm i safe-gatsby-image-plugin
2. Usage example
import{Image}from'safe-gatsby-image-plugin';// Example of of what a typical image object returned by Gatsby looks likeconstimageDataObj={localFile: {
alt_text,
source_url,childImageSharp: {fluid: {
...
}}}}<Imagedata={imageDataObj}className='image-class'style={{marginTop: 10}}/>
About
Fail-safe wrapper around gatsby-image React component