I've called this function in my gatsby-node.js file.
createPage({
path: `/article/`,
component: path.resolve(`./src/pages/article.js`),
// The context is passed as props to the component as well
// as into the component's GraphQL query.
context: {
craftercmsData
},
})
class IndexPage extends React.Component {
constructor(crafterCmsData) {
//how do I access my context data
}
render = () => {
}
How do I access context in my IndexPage class?