I am creating an Reactjs App that gets input in a text area. I want it to render the code if there is any html markup and show in another div block and bold or italic the text as it is done here in stackoverflow's text editor like or mkd.. Here is my code:
class App extends React.Component{
constructor(props){
super(props);
this.state={markdown:''};
this.handleChange=this.handleChange.bind(this);
}
handleChange(event){
this.setState({markdown:event.target.value});
}
render(){
return(<div className="main">
<textarea onChange={this.handleChange} type="text"/>
<div className="textShow">{this.state.markdown}</div>
</div>
)
}
}
What improvements should I make to it to render html markup and add other functionalities I have mentioned?
console.log('hello');``` it will be rendered to a bold text with a syntax highlighted console.log for that usemarkedpackage withhilight.js