Reputation: 818
Button don't work
class ContactList extends Component {
addTrack() {
console.log('addtrack');
}
render(){
console.log('addtrackssss');
return (
<div>
<input type="text" ></input>
<button onclick={this.addTrack.bind(this)}>Add Track</button>
</div>
);
}
}
Where my mistake. Do all like in this video https://www.youtube.com/watch?v=3FwoKdOMaFI
Upvotes: 0
Views: 1183
Reputation: 927
Handling events with React elements is very similar to handling events on DOM elements. But one of the difference is React events are named using camelCase, rather than lowercase.
//Regular Javascript:
<button onclick="doSomeThing()">
Click me!
</button>
//React:
<button onClick={doSomeThing}>
Click me!
</button>
Upvotes: 0