Skip to content

Commit 6de032d

Browse files
HUFGhaniGatsbyJS Bot
authored andcommitted
chore(docs): Update useStaticQuery example code (#18681)
* chore(docs): Update useStaticQuery example code * Update testing-components-with-graphql.md
1 parent a5ec39f commit 6de032d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/docs/testing-components-with-graphql.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,15 @@ the Header component as:
254254

255255
```jsx:title=src/components/header.js
256256
import React from "react"
257-
import { StaticQuery, graphql } from "gatsby"
257+
import { useStaticQuery, graphql } from "gatsby"
258258

259259
export const PureHeader = ({ data }) => (
260260
<header>
261261
<h1>{data.site.siteMetadata.title}</h1>
262262
</header>
263263
)
264264

265-
export const Header = props => (
265+
export const Header = props => {
266266
const data = useStaticQuery(graphql`
267267
query {
268268
site {
@@ -274,7 +274,7 @@ export const Header = props => (
274274
`)
275275

276276
return <PureHeader {...props} data={data}></PureHeader>
277-
)
277+
}
278278

279279
export default Header
280280
```

0 commit comments

Comments
 (0)