We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5ec39f commit 6de032dCopy full SHA for 6de032d
docs/docs/testing-components-with-graphql.md
@@ -254,15 +254,15 @@ the Header component as:
254
255
```jsx:title=src/components/header.js
256
import React from "react"
257
-import { StaticQuery, graphql } from "gatsby"
+import { useStaticQuery, graphql } from "gatsby"
258
259
export const PureHeader = ({ data }) => (
260
<header>
261
<h1>{data.site.siteMetadata.title}</h1>
262
</header>
263
)
264
265
-export const Header = props => (
+export const Header = props => {
266
const data = useStaticQuery(graphql`
267
query {
268
site {
@@ -274,7 +274,7 @@ export const Header = props => (
274
`)
275
276
return <PureHeader {...props} data={data}></PureHeader>
277
-)
+}
278
279
export default Header
280
```
0 commit comments