https://medium.com/@ericclemmons/react-event-preventdefault-78c28c950e46
https://facebook.github.io/react/docs/events.html
event.preventDefault();
// Let's stop this event.
event.stopPropagation();
// Really this time.
handleKeyDown(event) {
if (event.keyCode === 13) {
event.preventDefault(); // Let's stop this event.
event.stopPropagation(); // Really this time.
alert("Is it stopped?");
// "Hahaha, I'm gonna submit anyway!" - Chrome
}
}
event.nativeEvent.stopImmediatePropagation
Synthetic Events, not Native Events.
合成事件,而不是本地事件。
https://medium.com/@ericclemmons/react-event-preventdefault-78c28c950e46
https://stackoverflow.com/questions/24415631/reactjs-syntheticevent-stoppropagation-only-works-with-react-events#comment37772453_24415631
https://stackoverflow.com/questions/41464088/react-js-proxy-event