GatsbyJS

GatsbyJS

Using State & The Component Lifecycle in Gatsby.js

Using React State and the Component Lifecycle `componentDidMount()`, `constructor()`, and other event handlers in GatsbyJS pages isn't immediately obvious, as most of the boiler plate starters available online use a `const` method for handling props and template components. By extending the `React.component` as a class of our page template, we can handle state within the GatsbyJS page component.

Read