How to add onclick event to a string rendered by dangerouslysetInnerHtml in reactjs?
问题 I have a string , i.e, let string= "Hello <b>Click here</b>"; render() { return (<div dangerouslySetInnerHTML={this.createMarkup(value)}/> } createMarkup = value => { return { __html: value }; }; What I would like is to be able to add an onclick event to the <b> tag perform state manipulations on click. The underlying problem is where I had a function which was supposed to render whatever is passed by the API. The API would send a string 'Money received for order ID 123 ', or could be any