access to the endpoints wp api rest title post rendered inreact app


Staff member
I cracking my head against the wall, I'm developing a React App with wordpress as an API (wp rest API). everything is working well, I'm fetching and rendering all the post but when I go to the single post I can't fetch and render the title and content because it's said {rendered: "dwdwdf"} and I do the {post.title.rendered} as I do in the postlist component to get the title and works but in the single post doesn't.

To make it more clear here is the code:

const id =;
let postUrl = `${id}`;
  .then(data => data.json())
  .then(data => {
         item: data

when I console the this.state.item.title it shows me this:

{rendered: "dwdwdf"}
rendered: "dwdwdf"
__proto__: Object

it should be render as I do in my postlist component, like this {this.state.item.title.rendered} and done ! but not, it gave me this error:

TypeError: Cannot read property 'rendered' of undefined

I checked the api rest wp documentation and a lot of blogs and stackoverflow but I can't find anything that helps me.

if someone can guide me, thanks.