Created
August 11, 2020 20:34
-
-
Save josephrexme/9f2b18036f347345c0bccecc6a90c342 to your computer and use it in GitHub Desktop.
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, { useMemo } from 'react'; | |
import { graphql, useStaticQuery } from 'gatsby'; | |
import Img from 'gatsby-image'; | |
const MyComponent = ({ src, ...props }) => { | |
const data = useStaticQuery(graphql` | |
query { | |
myStuff( ) { | |
} | |
} | |
`); | |
const BlogEntries = useMemo(() => ( | |
data.mystuff.map(someMappingsHere) | |
), [ data, src ]); | |
return ( | |
<div><BlogEntries /></div> | |
); | |
}; | |
export default MyComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment