jjzjj

childImageSharp

全部标签

javascript - 具有动态图像源的可重用 Gatsby-Image 组件

我正在考虑在我的下一个项目中使用Gatsby-Image,并且已经尝试了一些。我让它在我的测试项目上工作,但后来我想出了一个用例,我想像使用常规一样使用Gatsby的标签。标签。如何使Gatsby组件可重用?importReactfrom"react"import{StaticQuery,graphql}from"gatsby"importImgfrom"gatsby-image"functionrenderImage({file}){console.log({file})return}//StatelessImagecomponentwhichIguesswill//receivet