I am getting data from API and it gives me an object with attribute head: '
When I call the HTML string in the head tag, it doesn't display anything. My code:
{data.head}
I also tried:
code works for me in body but not in head, Because div cannot be called in the head. I also tried using Fragment instead of div but it doesn't work even in body.
You cannot directly convert a string or object into a label. For your use case you can split the header object to get a specific header and use that.