Skip to content

Commit 883a458

Browse files
authored
fix(types): remove GestureResponderEvent (#1524)
* fix(react-native): remove GestureResponderEvent * remove from package.json * mention the change in the migration guide * fix migration guide
1 parent cae0884 commit 883a458

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
"@testing-library/user-event": "^14.4.3",
9696
"@types/jest": "^26.0.24",
9797
"@types/react": "^17.0.15",
98-
"@types/react-native": "^0.71.3",
9998
"@typescript-eslint/eslint-plugin": "^4.28.5",
10099
"@typescript-eslint/parser": "^4.28.5",
101100
"babel-plugin-macros": "^3.1.0",

src/hooks/MIGRATION_V8.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ Previously, the return value from the getter props returned by both Downshift
117117
and the hooks was `any`. In v8 we improved the types in order to reflect what is
118118
actually returned: the default values return by the getter prop function and
119119
whatever else the user passes as arguments. The type changes are done in
120-
[this PR](https://github.com/downshift-js/downshift/pull/1482), make sure you
120+
[this PR](https://github.com/downshift-js/downshift/pull/1482) and the
121+
[8.0.2 PR](https://github.com/downshift-js/downshift/pull/1524). Make sure you
121122
adapt your TS code, if applicable.
122123

123124
Also, in the `Downshift` component, the return values for some getter prop

typings/index.d.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as React from 'react'
2-
import * as ReactNative from 'react-native'
32

43
type Callback = () => void
54

@@ -159,7 +158,7 @@ interface GetToggleButtonPropsReturnValue {
159158
'aria-label': 'close menu' | 'open menu'
160159
'aria-haspopup': true
161160
'data-toggle': true
162-
onPress?: (event: ReactNative.GestureResponderEvent) => void
161+
onPress?: (event: React.BaseSyntheticEvent) => void
163162
onClick?: React.MouseEventHandler
164163
onKeyDown?: React.KeyboardEventHandler
165164
onKeyUp?: React.KeyboardEventHandler
@@ -602,7 +601,7 @@ export interface UseComboboxGetToggleButtonPropsReturnValue {
602601
'aria-controls': string
603602
'aria-expanded': boolean
604603
id: string
605-
onPress?: (event: ReactNative.GestureResponderEvent) => void
604+
onPress?: (event: React.BaseSyntheticEvent) => void
606605
onClick?: React.MouseEventHandler
607606
ref?: React.RefObject
608607
tabIndex: -1

0 commit comments

Comments
 (0)