Skip to content Skip to sidebar Skip to footer

Why Is React.js Not Loading HTML Code When Using Marked Library

I am trying to build a markdown editor for which I am using the Marked library My Code doesn't show any error but doesn't render the html at all. Code : The input I have given to

Solution 1:

this.state.value should be this.props.value because you are sending value in as a prop of TextArea:

class TextArea extends React.Component {
    render() {
        return (
            <div dangerouslySetInnerHTML={{__html: this.props.value}} />
        );
    }
}

Post a Comment for "Why Is React.js Not Loading HTML Code When Using Marked Library"