@samitouri / QOS-React / commits / 0a8da33916

React events: README update types and remove stopPropagation prop (#15456)

Nicolas Gallagher committed Apr 21, 2019 at 17:46 UTC 0a8da33916fceef9ffd93e393b3d64748ccab13a
1 file changed +9 -9
packages/react-events/README.md
+9 -9
@@ -29,6 +29,7 @@ const TextField = (props) => (
29 ```js
30 // Types
31 type FocusEvent = {
32 + target: Element,
33 type: 'blur' | 'focus' | 'focuschange'
34 }
35 ```
@@ -80,6 +81,7 @@ const Link = (props) => (
81 // Types
82 type HoverEvent = {
83 pointerType: 'mouse',
84 + target: Element,
85 type: 'hoverstart' | 'hoverend' | 'hovermove' | 'hoverchange'
86 }
87 ```
@@ -123,10 +125,6 @@ be called more than once before `onHoverEnd` is called.
125
126 Whether to `preventDefault()` native events.
127
126 -### stopPropagation: boolean = true
127 -
128 -Whether to `stopPropagation()` native events.
129 -
128
129 ## Press
130
@@ -165,6 +163,7 @@ const Button = (props) => (
163 // Types
164 type PressEvent = {
165 pointerType: 'mouse' | 'touch' | 'pen' | 'keyboard',
166 + target: Element,
167 type: 'press' | 'pressstart' | 'pressend' | 'presschange' | 'pressmove' | 'longpress' | 'longpresschange'
168 }
169
@@ -250,8 +249,9 @@ Ensure you pass in a constant to reduce memory allocations.
249
250 ### preventDefault: boolean = true
251
253 -Whether to `preventDefault()` native events.
254 -
255 -### stopPropagation: boolean = true
256 -
257 -Whether to `stopPropagation()` native events.
252 +Whether to `preventDefault()` native events. Native behavior is prevented by
253 +default. If an anchor is the child of `Press`, internal and external navigation
254 +should be performed in `onPress`/`onLongPress`. To rely on native behavior
255 +instead, set `preventDefault` to `false`, but be aware that native behavior will
256 +take place immediately after interaction without respect for delays or long
257 +press.