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;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…