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

Add number | null to ViewProps['hitSlop'] TypeScript type #41070

Closed
wants to merge 1 commit into from
Closed

Add number | null to ViewProps['hitSlop'] TypeScript type #41070

wants to merge 1 commit into from

Conversation

DimitarNestorov
Copy link
Contributor

Summary:

Setting the hitSlop of a View to be a number didn't work. The Flow type already allows number:

I updated it to match the TouchableWithoutFeedbackProps['hitSlop'] and PressableProps['hitSlop'] types.

Changelog:

[GENERAL] [FIXED] Add number | null to ViewProps['hitSlop'] TypeScript type

Test Plan:

Ran yarn test-typescript and yarn test-typescript-offline and there were no errors.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Oct 19, 2023
@github-actions
Copy link

Warnings
⚠️ One hour and a half have passed and the E2E jobs haven't finished yet.

Generated by 🚫 dangerJS against ec86a85

@facebook-github-bot
Copy link
Contributor

@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Oct 19, 2023
@facebook-github-bot
Copy link
Contributor

@javache merged this pull request in bc16bc5.

Othinn pushed a commit to Othinn/react-native that referenced this pull request Oct 30, 2023
…ok#41070)

Summary:
Setting the `hitSlop` of a `View` to be a `number` didn't work. The Flow type already allows `number`:
https://github.com/facebook/react-native/blob/6e42c98aa3423cfbc389e4fe877b5c6b559c8a81/packages/react-native/Libraries/Components/View/ViewPropTypes.js#L618

 I updated it to match the [`TouchableWithoutFeedbackProps['hitSlop']`](https://github.com/facebook/react-native/blob/6e42c98aa3423cfbc389e4fe877b5c6b559c8a81/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts#L72) and [`PressableProps['hitSlop']`](https://github.com/facebook/react-native/blob/6e42c98aa3423cfbc389e4fe877b5c6b559c8a81/packages/react-native/Libraries/Components/Pressable/Pressable.d.ts#L126) types.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] Add `number | null` to `ViewProps['hitSlop']` TypeScript type

Pull Request resolved: facebook#41070

Test Plan: Ran `yarn test-typescript` and `yarn test-typescript-offline` and there were no errors.

Reviewed By: rshest

Differential Revision: D50451318

Pulled By: javache

fbshipit-source-id: a0fceba270dbb80383cceb16f7719252a05b62b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants