WP API and React rendering HTML, not text

admin

Administrator
Staff member
I am creating a react wordpress blog. Right now I am sending a JSON request and getting all of the posts, this is working properly ) Once I have that I am creating a post object for each post.

I can properly display the title, image, etc. However when I try to display the content of the post using post.content.rendered ( i take the first 250 characters for a preview ) It is showing the actual html in the output for example instead of printing "Hello World" it is printing

Code:
<p>Hello World</p>

I am getting the json response successfully from: /wp-json/wp/v2/posts and i am returning the post info in the code below.

Code:
return (
    <article className="post-outer" id={post.id}>
      <section className="post-section">
        <a className="post-link">
          <div className="post-box" >
            <h1 className="post-title">
              {post.title.rendered}
            </h1>
            <p className="post-desc">
              {post.content.rendered.substring(0,250)}
            </p>
            </div>
          <figure className="media-wrapper"><img src={ this.state.media } /></figure>
        </a>
      </section>
    </article>
  )