From 6de032db99a53b2acd573be312ea0b3554933618 Mon Sep 17 00:00:00 2001 From: Hamza Ghani Date: Tue, 15 Oct 2019 14:55:23 +0100 Subject: [PATCH] chore(docs): Update useStaticQuery example code (#18681) * chore(docs): Update useStaticQuery example code * Update testing-components-with-graphql.md --- docs/docs/testing-components-with-graphql.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/testing-components-with-graphql.md b/docs/docs/testing-components-with-graphql.md index 33ddfcc563388..0444ff842a949 100644 --- a/docs/docs/testing-components-with-graphql.md +++ b/docs/docs/testing-components-with-graphql.md @@ -254,7 +254,7 @@ the Header component as: ```jsx:title=src/components/header.js import React from "react" -import { StaticQuery, graphql } from "gatsby" +import { useStaticQuery, graphql } from "gatsby" export const PureHeader = ({ data }) => (
@@ -262,7 +262,7 @@ export const PureHeader = ({ data }) => (
) -export const Header = props => ( +export const Header = props => { const data = useStaticQuery(graphql` query { site { @@ -274,7 +274,7 @@ export const Header = props => ( `) return -) +} export default Header ```