PressEvent is nullified before I can use it in onLongPress callback
Author: rajvatsalCreated Oct 1, 2026Updated Oct 1, 2026
Current Behavior
Callback given to onLongPress() event accepts an object of type PressEvent which is nullified by react, so it's not usable in the callback itself. I want to use nativeEvent property of that event which is null.
Expected Behavior
PressEvent shouldn't be nullified and I should be able to access properties like nativeEvent.
This works perfectly fine in reactnative's TouchHighlight and Pressable. I cannot style them without hard-coding color values (Tamagui button's use templates).
Tamagui Version
2.7.7Platform (Web, iOS, Android)
AndroidReproduction
https://github.com/rajvatsal/TamaguiError.git
npm start
npm run androidSystem Info
System:
OS: Linux 7.2 Fedora Linux 44 (Sway)
CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1235U
Memory: 9.00 GB / 15.30 GB
Container: Yes
Shell: 5.3.9 - /bin/bash
Binaries:
Node: 22.23.1 - /usr/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 10.9.8 - /usr/bin/npm
Watchman: 2026.07.27.00 - /home/linuxbrew/.linuxbrew/bin/watchman
Browsers:
Firefox: 156.0.1
Firefox Developer Edition: 156.0.1
npmPackages:
@babel/core: ^7.25.2 => 7.29.7
@babel/preset-env: ^7.25.3 => 7.29.7
@babel/runtime: ^7.25.0 => 7.29.7
@react-native-community/cli: 20.1.0 => 20.1.0
@react-native-community/cli-platform-android: 20.1.0 => 20.1.0
@react-native-community/cli-platform-ios: 20.1.0 => 20.1.0
@react-native/babel-preset: 0.84.0 => 0.84.0
@react-native/eslint-config: 0.84.0 => 0.84.0
@react-native/metro-config: 0.84.0 => 0.84.0
@react-native/new-app-screen: 0.84.0 => 0.84.0
@react-native/typescript-config: 0.84.0 => 0.84.0
@tamagui/config: ^2.7.7 => 2.7.7
@types/jest: ^29.5.13 => 29.5.14
@types/react: ^19.2.0 => 19.3.0
@types/react-test-renderer: ^19.1.0 => 19.3.0
eslint: ^8.19.0 => 8.57.1
jest: ^29.6.3 => 29.7.0
prettier: 2.8.8 => 2.8.8
react: 19.2.3 => 19.2.3
react-dom: ^19.2.3 => 19.2.3
react-native: 0.84.0 => 0.84.0
react-native-safe-area-context: ^5.5.2 => 5.10.1
react-test-renderer: 19.2.3 => 19.2.3
tamagui: ^2.7.7 => 2.7.7
typescript: ^5.8.3 => 5.9.3Source: tamagui/tamagui