Skip to content

[2.4.0] TS2322 error on setting Easing.bezier for easing option #2971

@TomCorvus

Description

@TomCorvus

Description

Hello 👋
Since 2.4.0 version, I have an TS error on easing definition with Easing.bezier.

error TS2322: Type '{ factory: () => EasingFunction; }' is not assignable to type 'EasingFunction'.
  Type '{ factory: () => EasingFunction; }' provides no match for the signature '(value: number): number'.

withTiming(0, { duration, easing: Easing.bezier(0, 0.79, 0.33, 0.99) })

Expected behavior

No error.

Actual behavior & steps to reproduce

See description and see example below.

Snack or minimal code example

You can try with the minimal example on Expo documentation:
https://docs.expo.dev/versions/latest/sdk/reanimated/#api-usage

Or:

offsetValue.value = withDelay(
	delay: 2000,
	withTiming(0, { duration: 2000, easing: Easing.bezier(0, 0.79, 0.33, 0.99) })
);

Package versions

name version
react-native ~0.66.4
react-native-reanimated ~2.4.1
typescript ^4.5.5

Affected platforms

Not relevant

Thanks for your help. 🙏

Metadata

Metadata

Assignees

Labels

Repro providedA reproduction with a snippet of code, snack or repo is provided

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions