Skip to content

Instantly share code, notes, and snippets.

@josephrexme
Created August 11, 2020 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephrexme/9f2b18036f347345c0bccecc6a90c342 to your computer and use it in GitHub Desktop.
Save josephrexme/9f2b18036f347345c0bccecc6a90c342 to your computer and use it in GitHub Desktop.
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