Created
April 5, 2024 19:49
-
-
Save PaulieScanlon/617140f824b9ae10938bb0f2984c6663 to your computer and use it in GitHub Desktop.
Example Gatsby Child Component
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
// src/components/child-component.js | |
import { useStaticQuery, graphql } from 'gatsby'; | |
const ChildComponent = () => { | |
const data = useStaticQuery(graphql` | |
query { | |
github { | |
id | |
owner { | |
login | |
url | |
} | |
description | |
} | |
} | |
`); | |
return <pre>{JSON.stringify(data, null, 2)}</pre>; | |
}; | |
export default ChildComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment