Created
May 11, 2019 14:36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import { graphql } from "gatsby" | |
import Img from "gatsby-image" | |
const Image = ({ data }) => ( | |
<div> | |
<h1>Hello gatsby-image</h1> | |
{console.log(data)} | |
<Img fluid={data.file.childImageSharp.fluid} /> | |
</div> | |
) | |
export default Image | |
export const query = graphql` | |
query { | |
file(relativePath: { eq: "fabio.jpg" }) { | |
childImageSharp { | |
fluid(maxWidth: 300) { | |
...GatsbyImageSharpFluid | |
} | |
} | |
} | |
} | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment