Skip to content

[Web] Fix delayTimeout type FlingGestureHandler - #4471

Merged
m-bert merged 2 commits into
mainfrom
@mbert/fling-timeout-type
Aug 26, 2026
Merged

[Web] Fix delayTimeout type FlingGestureHandler#4471
m-bert merged 2 commits into
mainfrom
@mbert/fling-timeout-type

Conversation

@m-bert

@m-bert m-bert commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Leftover from #4381: the web handlers' timeout fields were changed to ReturnType<typeof setTimeout>. FlingGestureHandler was the one that PR missed.

Test plan

yarn ts-check passes

Copilot AI lite review requested due to automatic review settings August 25, 2026 08:42
@m-bert
m-bert requested a review from j-piasecki August 25, 2026 08:42
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a523a222-1b5f-4e94-84fd-a1ce15bdc71d

📥 Commits

Reviewing files that changed from the base of the PR and between f22d3bd and bffced9.

📒 Files selected for processing (1)
  • packages/react-native-gesture-handler/src/web/handlers/FlingGestureHandler.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved timer compatibility across supported environments by correcting timeout handling for fling gestures.

Walkthrough

The web fling gesture handler updates its private delayTimeout declaration to allow undefined while retaining the environment-specific ReturnType<typeof setTimeout> type.

Changes

Fling timeout typing

Layer / File(s) Summary
Update timeout handle type
packages/react-native-gesture-handler/src/web/handlers/FlingGestureHandler.ts
The private delayTimeout property now allows undefined and uses ReturnType<typeof setTimeout>.

Merge Risk: ⚪ Minimal · up to bffce

This localized type-only fix is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the web FlingGestureHandler change and the delayTimeout type fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a TypeScript typing inconsistency in the web implementation of FlingGestureHandler by updating its timeout field type to match the ReturnType<typeof setTimeout> approach introduced in #4381, improving compatibility for consumers whose TS programs include @types/node.

Changes:

  • Update FlingGestureHandler’s delayTimeout field type from number to ReturnType<typeof setTimeout>.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 24 to 27
private maxDurationMs = DEFAULT_MAX_DURATION_MS;
private minVelocity = DEFAULT_MIN_VELOCITY;
private delayTimeout!: number;
private delayTimeout!: ReturnType<typeof setTimeout>;

@m-bert
m-bert merged commit 80cfa6f into main Aug 26, 2026
5 checks passed
@m-bert
m-bert deleted the @mbert/fling-timeout-type branch August 26, 2026 07:33
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.

3 participants