Skip to content

Instantly share code, notes, and snippets.

@yoshuawuyts
Created February 17, 2014 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoshuawuyts/9053943 to your computer and use it in GitHub Desktop.
Save yoshuawuyts/9053943 to your computer and use it in GitHub Desktop.
edititem linkButton.clickHandler: Cannot call method 'preventDefault' of undefined react-0.8.0-min.js:7276 Uncaught TypeError: Cannot call method 'preventDefault' of undefined linkComponent.js:7
edititem linkButton.clickHandler: Cannot call method 'preventDefault' of undefined react-0.8.0-min.js:7276
Uncaught TypeError: Cannot call method 'preventDefault' of undefined linkComponent.js:7
'use strict';
module.exports = React.createClass({
displayName: 'edititem linkButton',
clickHandler: function(name) {
event.preventDefault();
Backbone.history.navigate('/' + name, true);
},
render: function() {
return (
React.DOM.a({href: '/' + this.props.name, onClick: this.clickHandler(this.props.name)}, this.props.name)
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment