In order to display the generated HTML from a Markdown post, we will build a GraphQL query and pass its data into a Template component that makes use of React’s dangerouslySetInnerHTML
API to add a DOM element.
why doesn't this query work in graphiql?
query($pathSlug:String!){
markdownRemark(frontmatter: {path:{eq:$pathSlug}}){
html
frontmatter{
title
}
}
}
style={{fontFamily: 'avenir'}}
should be inside h1 tag as:
<h1 style={{fontFamily: 'avenir'}}>