From 4597116dc53c294692a10c4692fa08596bd4a3a2 Mon Sep 17 00:00:00 2001 From: Aswin C P Date: Sat, 20 Jul 2019 06:55:53 +0530 Subject: [PATCH] added few info on non-page components (#15198) * added more info on Querying data. Querying data using static query docs and example added fixes #15195 * added few info on non page components removed br tags and added few info on non page components. * Added few lines on Non-page components removed br tags and added few info on non-page components. * Update building-with-components.md * Apply suggestions from code review * chore: format --- docs/docs/building-with-components.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/docs/building-with-components.md b/docs/docs/building-with-components.md index c2c284358eff9..b46acfb53d265 100644 --- a/docs/docs/building-with-components.md +++ b/docs/docs/building-with-components.md @@ -167,3 +167,8 @@ These are examples of the different ways React components are used in Gatsby sites. To see full working examples, check out the [examples directory](https://github.com/gatsbyjs/gatsby/tree/master/examples) in the Gatsby repo. + +### Non-page components + +A Non-page component is one that's embedded inside some other component, forming a component hierarchy. An example would be a Header component that's included in multiple page components. +Gatsby uses GraphQL to enable components to declare the data they need. Using the [StaticQuery](/docs/static-query/) component or [useStaticQuery hook](/docs/use-static-query/), you can colocate a non-page component with its data.