Common components (e.g. <div>)·续4

<input
  onCopy={e => console.log('onCopy')}
  onCut={e => console.log('onCut')}
  onPaste={e => console.log('onPaste')}
/>

Parameters


CompositionEvent handler function

An event handler type for the input method editor (IME) events.

<input
  onCompositionStart={e => console.log('onCompositionStart')}
  onCompositionUpdate={e => console.log('onCompositionUpdate')}
  onCompositionEnd={e => console.log('onCompositionEnd')}
/>

Parameters


DragEvent handler function

An event handler type for the HTML Drag and Drop API events.

<>
  <div
    draggable={true}
    onDragStart={e => console.log('onDragStart')}
    onDragEnd={e => console.log('onDragEnd')}
  >
    Drag source
  </div>

<div
    onDragEnter={e => console.log('onDragEnter')}
    onDragLeave={e => console.log('onDragLeave')}
    onDragOver={e => { e.preventDefault(); console.log('onDragOver'); }}
    onDrop={e => console.log('onDrop')}
  >
    Drop target
  </div>
</>

Parameters

It also includes the inherited MouseEvent properties:

It also includes the inherited UIEvent properties:


FocusEvent handler function

An event handler type for the focus events.

<input
  onFocus={e => console.log('onFocus')}
  onBlur={e => console.log('onBlur')}
/>

See an example.

Parameters

It also includes the inherited UIEvent properties:


Event handler function

An event handler type for generic events.

Parameters


InputEvent handler function

An event handler type for the onBeforeInput event.

<input onBeforeInput={e => console.log('onBeforeInput')} />

Parameters


KeyboardEvent handler function

An event handler type for keyboard events.

<input
  onKeyDown={e => console.log('onKeyDown')}
  onKeyUp={e => console.log('onKeyUp')}
/>

See an example.

Parameters

It also includes the inherited UIEvent properties:


MouseEvent handler function

An event handler type for mouse events.

<div
  onClick={e => console.log('onClick')}
  onMouseEnter={e => console.log('onMouseEnter')}
  onMouseOver={e => console.log('onMouseOver')}
  onMouseDown={e => console.log('onMouseDown')}
  onMouseUp={e => console.log('onMouseUp')}
  onMouseLeave={e => console.log('onMouseLeave')}
/>

See an example.

Parameters

It also includes the inherited UIEvent properties:


PointerEvent handler function

An event handler type for pointer events.

<div
  onPointerEnter={e => console.log('onPointerEnter')}
  onPointerMove={e => console.log('onPointerMove')}
  onPointerDown={e => console.log('onPointerDown')}
  onPointerUp={e => console.log('onPointerUp')}
  onPointerLeave={e => console.log('onPointerLeave')}
/>

See an example.

Parameters

It also includes the inherited MouseEvent properties:

It also includes the inherited UIEvent properties:


TouchEvent handler function

An event handler type for touch events.

<div
  onTouchStart={e => console.log('onTouchStart')}
  onTouchMove={e => console.log('onTouchMove')}
  onTouchEnd={e => console.log('onTouchEnd')}
  onTouchCancel={e => console.log('onTouchCancel')}
/>

Parameters

It also includes the inherited UIEvent properties:


TransitionEvent handler function

An event handler type for the CSS transition events.

<div
  onTransitionEnd={e => console.log('onTransitionEnd')}
/>

Parameters


UIEvent handler function

An event handler type for generic UI events.

<div
  onScroll={e => console.log('onScroll')}
/>

Parameters


WheelEvent handler function

An event handler type for the onWheel event.

<div
  onWheel={e => console.log('onWheel')}
/>

Parameters

It also includes the inherited MouseEvent properties:

It also includes the inherited UIEvent properties: