-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrapper component not rendering HTML properly #94
Comments
@mohamedelhosseiny most likely because did you try just rendering |
I don't use JSX myself, but I would also think that you should render to a React element instead of raw HTML. |
@simplecommerce Would you mind providing an example using jsx to render as react element instead of using Thanks! |
excellent! Thank you @simplecommerce |
Hi @simplecommerce i just tried rendering html returned from an api using the example you linked to me. My app is rendering UPDATE: Never mind, i realized that i needed to parse the html into a string before running it through. Im struggling with trying to render an html table. I saw a couple of issues posted about whitespace problems but i cant seem to get a working solution in place. Has anyone ever gotten a successful render of an html table using html-to-react? If so, would really love an example! |
@mcastre The example in my issue is rendering html string to react. Your issue is here in your code:
you are converting the reactElement back into string and then trying to render it. when you want to render html string you need to use https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml but I don't understand why you wouldn't just follow the example I wrote and just render the converted react element directly instead of using This should be your logic. html string table > pass it to html-to-react > render it right now from what I see you are doing this: html string table > pass it to html-to-react > pass it to renderToStaticMarkup > render. |
Closing due to inactivity. |
Hello, so I have a wrapper component which recieves a String as prop and should render it as HTML:
it's currently rendering a String.
Do you have any idea why?
The text was updated successfully, but these errors were encountered: