Can't .map with StaticImage #31760
-
DescriptionI'm declaring local variables in scope of the file as explained in the doc
When I want to map in the return like this
it throws me Expected resultStaticImage component with correct working src attributes. Actual result
Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can't use that syntax as it's currently not supported. For mapping over the images you'd need to query them with GraphQL and use One could (probably) implement this by sending in a PR to https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts |
Beta Was this translation helpful? Give feedback.
You can't use that syntax as it's currently not supported. For mapping over the images you'd need to query them with GraphQL and use
<GatsbyImage />
.One could (probably) implement this by sending in a PR to https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts