0

I am fetching data from api(created in php),There is description field (data saved by ckeditor)

In my db/api data is saving in following format

<p><strong>Hello admin <em>Lorem Ipsum dummy text</em></strong></p>

And i am using "ReactHtmlParser" for display blog content in web page

{ReactHtmlParser(post.description)}

But its showing me data in following format,how can i solve this ?

<p><strong>Hello admin <em>Lorem Ipsum dummy text</em></strong></p>

My expected output is " Hello admin Lorem Ipsum dummy text "

amit
  • 1
  • 1
  • 18
  • 28
  • take a look at this - https://stackoverflow.com/questions/44643424/how-to-parse-html-to-react-component – jon doe Jun 29 '22 at 08:13
  • 1
    Does this answer your question? [How to parse html to React component?](https://stackoverflow.com/questions/44643424/how-to-parse-html-to-react-component) – Tom Jun 29 '22 at 08:13
  • @jondoe: i tried but not working for me – amit Jun 29 '22 at 08:18
  • @Tom: as i mentioned its giving me "

    Hello admin Lorem Ipsum dummy text

    " in my web but whenever i use this code into "dangerouslySetInnerHTML" then its working fine
    – amit Jun 29 '22 at 08:25
  • How are you using it in your React component? Can you add the component code? – Tom Jul 04 '22 at 08:37

0 Answers0