Easing functions are typed as methods, so passing them trips @typescript-eslint/unbound-method

Open
#59,941 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@dkarlovi is already working on this.

Since Nov 11, 2026.

  • #59943 by @dkarlovi — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript, react-native, typescript

Research direction

Start with Libraries/Animated/Easing.js and inspect the generated declaration at types_generated/Libraries/Animated/Easing.d.ts. Confirm the declarations expose the easing functions as properties with function types, then run the reproducer's ESLint command to check that passing Easing.cubic no longer triggers @typescript-eslint/unbound-method. An open pull request, #59943, is already linked to this issue.

Written by the indexing model from the issue text.

Description

Needs: Attention Needs: Repro
Description

Libraries/Animated/Easing.js declares linear, ease, cubic etc. with method shorthand, so types_generated/Libraries/Animated/Easing.d.ts emits cubic(t: number): number;. None of them reads this, and the documented usage passes them unbound (easing: Easing.cubic), which fails typescript-eslint's recommendedTypeChecked (@typescript-eslint/unbound-method).

Fix: declare them as arrow-function properties, so the types become cubic: (t: number) => number.

Steps to reproduce
  1. Clone the reproducer gist.
  2. npm install --ignore-scripts
  3. npx eslint index.ts
React Native Version

0.88.1

Affected Platforms

Other (type definitions)

Output of npx @react-native-community/cli info
Not applicable: type definitions only, no app.
Stacktrace or Logs
4:46  error  A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object  @typescript-eslint/unbound-method
MANDATORY Reproducer

https://gist.github.com/dkarlovi/4c0a3edcec5fab42be4aec8eb6ff1d80

Screenshots and Videos

No response

Dominant language
C++
Stars
127k
Forks
25.5k
Avg merge
3d 22h
Merged PRs (30d)
235

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react/react-native

All issues in react/react-native

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.