1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Create a Custom Hook for Site Metadata in Gatsby

    gatsbyGatsby

    Gatsby's useStaticQuery hook is really useful for getting site metadata from our Gatsby config into our components. In fact, it's so useful that we end up using it all over the place and duplicating a lot of code! Luckily, since useStaticQuery is just a React hook, we can use it to compose our own custom useSiteMetadata hook.