I have an HTML tag value in my state variable as
this.state = {
value: '<p>This is a paragraph</p>'
}
I want to display this HTML content in my child component. I'm trying to do as
<Childcomponent value={this.state.value} />
So that i can use the props
to access the value inside the child component.
My child component is
render() {
return(
<div>{this.props.value}</div>
)
}
But this produces some errors. How can I fix this? Is there any other solution? Thanks in advance.