Open mikaello opened 7 years ago
Any reaction on this? I face the same issue
This is actually not limited to just SyntheticTouchEvent
. Right now all Synthetic*Event
types specify their nativeEvent
key as a plain Event
. It would be more accurate to make those events more specific, ie:
SyntheticMouseEvent.nativeEvent
should be MouseEvent
SyntheticWheelEvent.nativeEvent
should be WheelEvent
I've opened a Pull Request to address the issue: https://github.com/facebook/flow/pull/5303
When using PanResponder in react-native, an event of type synthetic touch event is made available as a variable. This has a property
nativeEvent
with the following propertiesidentifier
,locationX
,locationY
,pageX
,pageY
,target
,timestamp
,touches
.SyntheticTouchEvent
in flow does have a propertynativeEvent
(by inheritance), but this points toEvent
which does not contain all the properties mentioned in the PanResponder-docs. The PanResponder-docs does not seem in sync with the types flow have defined.When looking at the RN-code for places where a similar event is used, it is made an ad hoc solution:
Does this mean that the synthetic touch event mentioned in PanResponder-docs (or Gesture Responder System-docs) is not the same as SyntheticTouchEvent mentioned in flow? Or is one of them not correct/up to date?
See example usage in flow try.