1onClick
2onContextMenu
3onDoubleClick
4onDrag
5onDragEnd
6onDragEnter
7onDragExit
8onDragLeave
9onDragOver
10onDragStart
11onDrop
12onMouseDown
13onMouseEnter
14onMouseLeave
15onMouseMove
16onMouseOut
17onMouseOver
18onMouseUp
1 handleClick(event) {
2 event.persist();
3 this.setState((prevState) => ({
4 foo: prevState.foo + event.pageX
5 }));
6 }
1//Without event.persist() ,
2//React will make the first event value as null when second event is fired.
3
4//How to use?
5
6const handleFilterChange = (event) => {
7 event.persist();
8 setFilters(currentFilters => (
9 produce(currentFilters, draftFilter => {
10 draftFilter[event.target.name] = event.target.value;
11 })
12 ))
13 };