Skip to content

Commit 410d0ac

Browse files
committed
fix(plugin-reanimated): Use constants for gentle spring configs instead of importing from reanimated for backwards compat
1 parent 0699b03 commit 410d0ac

File tree

4 files changed

+84
-78
lines changed

4 files changed

+84
-78
lines changed

.changeset/cold-phones-drive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@plextv/react-lightning-plugin-reanimated": patch
3+
---
4+
5+
fix(plugin-reanimated): Use constants for gentle spring configs instead of importing from reanimated for backwards compat

packages/plugin-reanimated/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@types/react": "19.2.2"
4747
},
4848
"peerDependencies": {
49-
"@lightningjs/renderer": "^3.0.0-beta15",
49+
"@lightningjs/renderer": "3.0.0-beta15",
5050
"@plextv/react-lightning": "workspace:^",
5151
"@plextv/react-lightning-plugin-css-transform": "workspace:^",
5252
"@plextv/react-lightning-plugin-flexbox": "workspace:^",

packages/plugin-reanimated/src/animation/spring.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// See: https://github.com/software-mansion/react-native-reanimated/tree/main/packages/react-native-reanimated/src/animation/spring
33
import type { AnimationSettings } from '@lightningjs/renderer';
44
import {
5-
GentleSpringConfig,
6-
GentleSpringConfigWithDuration,
75
ReduceMotion,
86
type WithSpringConfig,
97
} from 'react-native-reanimated-original';
@@ -22,8 +20,11 @@ import {
2220
const cache = new Map<string, AnimationSettings>();
2321

2422
const DefaultConfig: DefaultSpringConfig = {
25-
...GentleSpringConfig,
26-
...GentleSpringConfigWithDuration,
23+
damping: 120,
24+
mass: 4,
25+
stiffness: 900,
26+
duration: 550,
27+
dampingRatio: 1,
2728
overshootClamping: false,
2829
energyThreshold: 6e-9,
2930
velocity: 0,

pnpm-lock.yaml

Lines changed: 73 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)