Building a site which shows users profiles. When changing from one profile to another, the profile description is getting stuck with the previous users profile data.
For example
- Visit users profile 1
- Users profile description reads
User profile 1 description
- Visit users profile 2
- Users profile description reads
User profile 1 description User profile 2 description
My code is all being run in the render function of my component so should be rerendering when state updates.
render(){
return(
<h4>Profile 1<h4>
<p dangerouslySetInnerHTML={{__html: this.props.profile.description}} />
)
}