React 中监听 input 的 onChange 事件的原生事件是什么
Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 611 (opens in a new tab)
Author 回答者: shfshanyue (opens in a new tab)
React 中 onChange 的原生事件是什么? (opens in a new tab)
import "./styles.css";
export default function App() {
return (
<div className="App">
<input
onChange={(e) => {
console.log("Event: ", e);
console.log("NativeEvent: ", e.nativeEvent);
console.log("CurrentTarget: ", e.nativeEvent.currentTarget);
console.log("NativeEvent Type: ", e.nativeEvent.type);
}}
/>
</div>
);
}