javascript - anchor tag (a tag) onclick event handler not working -


Although I have included the onclick handler for the one tag in the HTML returned by the render method Components of Reaction Components (Component with Place Position presented by name), Although rendering is done correctly, the onclick handler feature does not appear in HTML presented on the webpage. I do not want to understand the issue, here is the code

[ 'link1', 'link:' link4 ',' link3 ']}, {display_name: "sultan", content: Content: "This is John Post", link: ['link7', 'link8', 'link4', 'link5', 'link6']}, {display_name: "John" 'Link9']}]}}, fetchFeedsFromUrl: function () {console.log ('onclick trigger');}, render: function () {return (& lt; feeds date a = {this.state.data} onclick = {This.fetchFeedsFromUrl} / & gt;)}} Feeds = Response .createclass ({rendere: function () {var onClickfunc = this.props.onClick; var feeds = this.props.data.map (function ) {Return ( gt; {feeds}} / Div & gt;)}}} var afeed = rect .createclass ({rendere: function () {returns (
gt; & lt; h3 & gt; {this.props.name} & lt; / h3 & Gt; & lt; RenderLink Click on Link = {this.props.onClick} linkArray = {this.props.links} / & gt; & Lt; P & gt; {This.props.content} & lt; / P & gt; & Lt; / Div>)}}); Var render location = link (response) .createclass ({rendere: function () {var onClick = this.props.onClick; var locationLinks = this.props.linkArray.map (function (link, index) {return (& lt; A onClick = {this .onclick} href = {link} & gt; {link} gt; {location links} & lt; / div & gt; )}}} React.renderComponent (feedApp (tap), document.);

You do not have to specify the "this" reference in your map functions for your local functions. When you try to use the onClick variable, then "this" is displayed. Take.

  var render location location = link .createclass ({rendere: function () {var onClick = this.props.onClick; var locationLinks = this .props.linkArray.map (function ( Link, index) {return ( {LocationLinks} & Lt; / div & gt;)}})  

Comments