123
rated 0 times
[
124]
[
1]
/ answers: 1 / hits: 18174
/ 8 Years ago, tue, september 6, 2016, 12:00:00
I'm making an app and I want to fire a function (in this case the showMessage
) when the user presses Ctrl + Enter.
How would I do this, preferably without jQuery?
import React from react
const App = React.createClass({
showMessage () {
console.log('hit');
},
render () {
return (
<div>
<button onClick={this.showMessage}>Hit</button>
</div>
);
}
});
module.exports = App;
More From » reactjs