couds / react-bulma-components

React components for Bulma framework
MIT License
1.2k stars 129 forks source link

Content is not working with dynamic content #401

Closed dipeshparashar closed 1 year ago

dipeshparashar commented 2 years ago

I am using v4.0.2 . Trying to use Content component with dynamic content. It does not render html elements. Let me know if i am doing anything wrong here. How can i resolve this ?

 <Message >
       <Content >
            {n.message}
       </Content>
 </Message>

Rendered UI

Bulma-Content-Dynamic

couds commented 1 year ago

Hi @dipeshparashar this is how react works, if you want to render html that is coming from a variable you need to use dangerouslysetinnerhtml https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml

diploidal commented 1 year ago

Hey, I don't want to bother You @couds but You've tagged wrong person. 😃

It is not a huge problem but by fixing tagged user You'll be sure that the author of this issue is notified. 😃

couds commented 1 year ago

Hi @diploidal Thanks for let me know! just updated the comment!