Skip to content

Change declaration for GestureHandlerProperties from 'string' to 'React.Ref'#298

Merged
kmagiera merged 1 commit intosoftware-mansion:masterfrom
m-tymchyk:gesture-handler-typescript-declarations
Oct 1, 2018
Merged

Change declaration for GestureHandlerProperties from 'string' to 'React.Ref'#298
kmagiera merged 1 commit intosoftware-mansion:masterfrom
m-tymchyk:gesture-handler-typescript-declarations

Conversation

@m-tymchyk
Copy link
Copy Markdown
Contributor

No description provided.

@m-tymchyk m-tymchyk force-pushed the gesture-handler-typescript-declarations branch from 3a71896 to c4f50bc Compare September 28, 2018 11:14
Copy link
Copy Markdown
Member

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this PR @m-tymchyk !

Didn't know about that Ref type. For react version compatibility reasons (versions w/o createRef) we also need to support strings and string arrays. Can you make a change to allow both waitFor and simultaneousHandlers accept string and string[] as well as the new ref types you added?

@m-tymchyk
Copy link
Copy Markdown
Contributor Author

Type Ref includes string.

type Ref<T> = string | { bivarianceHack(instance: T | null): any }["bivarianceHack"] | RefObject<T>;

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L61

Copy link
Copy Markdown
Member

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, thanks

@kmagiera kmagiera merged commit a119b9b into software-mansion:master Oct 1, 2018
@m-tymchyk
Copy link
Copy Markdown
Contributor Author

^_^

janicduplessis pushed a commit to janicduplessis/react-native-gesture-handler that referenced this pull request Feb 16, 2020
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

Successfully merging this pull request may close these issues.

2 participants