PressEvent object is returned in the callback as a result of user press interaction, for example onPress in Button component.
{
changedTouches: [PressEvent],
identifier: 1,
locationX: 8,
locationY: 4.5,
pageX: 24,
pageY: 49.5,
target: 1127,
timestamp: 85131876.58868201,
touches: []
}
changedTouchesArray of all PressEvents that have changed since the last event.
| Type | Optional |
|---|---|
| array of PressEvents | No |
force Amount of force used during the 3D Touch press. Returns the float value in range from 0.0 to 1.0.
| Type | Optional |
|---|---|
| number | Yes |
identifierUnique numeric identifier assigned to the event.
| Type | Optional |
|---|---|
| number | No |
locationXTouch origin X coordinate inside touchable area (relative to the element).
| Type | Optional |
|---|---|
| number | No |
locationYTouch origin Y coordinate inside touchable area (relative to the element).
| Type | Optional |
|---|---|
| number | No |
pageXTouch origin X coordinate on the screen (relative to the root view).
| Type | Optional |
|---|---|
| number | No |
pageYTouch origin Y coordinate on the screen (relative to the root view).
| Type | Optional |
|---|---|
| number | No |
targetThe node id of the element receiving the PressEvent.
| Type | Optional |
|---|---|
number, null, undefined
|
No |
timestampTimestamp value when a PressEvent occurred. Value is represented in milliseconds.
| Type | Optional |
|---|---|
| number | No |
touchesArray of all current PressEvents on the screen.
| Type | Optional |
|---|---|
| array of PressEvents | No |
ButtonPanResponderPressableScrollViewTextTextInputTouchableHighlightTouchableOpacityTouchableNativeFeedbackTouchableWithoutFeedbackView
© 2022 Facebook Inc.
Licensed under the Creative Commons Attribution 4.0 International Public License.
https://reactnative.dev/docs/pressevent