Render dynamic html in react js

Arnold Mapps

I want to render a dynamic html text provide by a API in react js but I don't know how to do.

for example :

   dynamicHtml= <div> hello <span color=red> StackOverFlow </span> </div>

   render() {

        return (
            <div>  {dynamicHtml} </div>
        );
   }

I want to dysplay only Hello StackOverFlow with the red color on StackOverFlow

learning_vba

use dangerouslySetInnerHTML

     function createMarkup(text) { return {__html: text}; };
     <render() {

            return (
               <div dangerouslySetInnerHTML={createMarkup()} />
            );
       }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

React.js render text as HTML

From Dev

How to render an html entity in React.js without JSX

From Dev

How can I generate HTML by function and render it later in JS React

From Dev

React js render html string returned from server

From Dev

Draft.js and stateToHTML, how to render output html in react component?

From Dev

Render HTML in React Native

From Dev

React JS isomorphic render

From Java

How to create dynamic href in react render function?

From Dev

How to safely render html in react?

From Dev

React | render html tag in jsx

From Dev

react.js - Render on requestAnimationFrame

From Dev

React Js onClick inside render

From Dev

Render staggering images in React JS

From Dev

Render html with node.js

From Java

Render HTML string as real HTML in a React component

From Dev

React JS - React Router - Render content separately

From Dev

Render HTML without the extra "data-reactid" DOM attribute in React.js?

From Dev

React JS Dynamic Data Fetching

From Dev

How to render a react element using an html string?

From Dev

Why my react html render is not working?

From Dev

How to render conditional HTML elements in React

From Dev

Render a single react component in a html file (webpack)

From Dev

React data components table does not render HTML

From Dev

Render React code to HTML file with npm

From Dev

Render different html depending on index of object in react

From Dev

React.js: Refs are not available on initial render

From Dev

React js - Disable render of a component in a mixin

From Dev

Render React JS server side using .net

From Dev

Loop and render an object in React.js