Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null is not an object (evaluating 'event.nativeEvent.pageX) #26

Open
pailjin opened this issue Jan 23, 2021 · 0 comments
Open

null is not an object (evaluating 'event.nativeEvent.pageX) #26

pailjin opened this issue Jan 23, 2021 · 0 comments

Comments

@pailjin
Copy link

pailjin commented Jan 23, 2021

"react-native": "0.63.2",

会报错:
null is not an object (evaluating 'event.nativeEvent.pageX)
因为
onLongPress={this.speedLongTouch}
onPressOut={this.speedLongTouchOut}
var speedStartX = evt.nativeEvent.pageX
中的nativeEvent不存在。

官方文档:
https://reactnative.dev/docs/pressevent
example:
{
changedTouches: [PressEvent],
identifier: 1,
locationX: 8,
locationY: 4.5,
pageX: 24,
pageY: 49.5,
target: 1127,
timestamp: 85131876.58868201,
touches: []
}
不需要nativeEvent吧。直接pageX就行。我理解没错吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant