Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReactMarkdown does not render or display blog content #2

Open
Trushar10 opened this issue May 26, 2021 · 0 comments
Open

ReactMarkdown does not render or display blog content #2

Trushar10 opened this issue May 26, 2021 · 0 comments

Comments

@Trushar10
Copy link

Trushar10 commented May 26, 2021

in the blog-template.js, using only { content } displays the blog content. But using the ReactMarkdown component displays nothing.

My repository link: portfolio

Screenshot (94)

using { content } displays

# JavaScript Hard Parts ## Subtitle - first item - second item - third item > I'm baby dIY beard kogi tumeric butcher freegan. Schlitz vaporware everyday carry small batch, taxidermy deep v glossier iceland truffaut retro asymmetrical bitters tattooed post-ironic vape. Jean shorts blog edison bulb, yr tousled banjo lumbersexual 3 wolf moon squid artisan poutine typewriter. Cray pinterest master cleanse helvetica, godard heirloom taiyaki kinfolk hell of locavore. ``` allStrapiProjects { nodes { github id description title ```

I had not modified any text. Only uncommented it.

blog-template.js

import React from "react"
import { graphql, Link } from "gatsby"
import Layout from "../components/Layout"
import ReactMarkdown from "react-markdown"

const ComponentName = ({ data }) => {
  const { content } = data.blog

  return (
    <Layout>
      <section className="blog-template">
        <div className="section-center">
          <article className="blog-content">
            <ReactMarkdown source={content}></ReactMarkdown>
          </article>
          <Link to="/blog" className="btn center-btn">
            blog
          </Link>
        </div>
      </section>
    </Layout>
  )
}

export const query = graphql`
  query GetSingleBlog($slug: String) {
    blog: strapiBlogs(slug: { eq: $slug }) {
      content
    }
  }
`

export default ComponentName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant