You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(skill): version-aware Reanimated default mapping (v2/v3 vs v4)
Reanimated v4 changed spring defaults significantly (damping 120,
stiffness 900, mass 4 β critically damped). The skill now detects the
Reanimated version from package.json in Phase 1 and uses the correct
default table for migration.
@@ -99,26 +105,43 @@ Use this table to convert Reanimated/Animated patterns to EaseView:
99
105
100
106
**CRITICAL: Reanimated and EaseView have different defaults. You MUST explicitly set values to preserve the original animation behavior. Do not rely on EaseView defaults matching Reanimated defaults.**
101
107
108
+
**Use `reanimatedVersion` from Phase 1 to select the correct defaults.**
|`damping`|`120`|`15`|**Must set `damping: 120`**|
125
+
|`stiffness`|`900`|`120`|**Must set `stiffness: 900`**|
126
+
|`mass`|`4`|`1`|**Must set `mass: 4`**|
127
+
128
+
Reanimated v4 changed to a critically damped, snappy spring (no bounce) as the default. The rationale was that the old physics-based defaults were too sensitive to start/end conditions. v4 recommends using `duration` + `dampingRatio` instead of raw physics params.
129
+
110
130
If the source code explicitly sets any of these values, carry them over as-is. If the source relies on Reanimated defaults (no explicit value), set the Reanimated default explicitly on the EaseView transition.
111
131
112
132
Example β bare `withSpring(1)` with no config:
113
133
```typescript
114
134
// Before (Reanimated)
115
135
scale.value=withSpring(1);
116
136
117
-
// After (EaseView) β must set damping: 10, stiffness: 100 to match
137
+
// After (EaseView) β v2/v3: set damping: 10, stiffness: 100
**Note:** Reanimated v3+ uses duration-based spring by default (`duration: 550`, `dampingRatio: 1`) when no physics params are set. If migrating code that uses `withSpring` without any config, use `damping: 10, stiffness: 100` which matches the physics-based fallback. If the code explicitly sets `dampingRatio`/`duration`, convert using: `damping = dampingRatio * 2 * sqrt(stiffness * mass)`.
144
+
**Duration-based spring:** Reanimated v3+ also supports `withSpring(target, { duration, dampingRatio })`. If the code explicitly sets `dampingRatio`/`duration`, convert using: `damping = dampingRatio * 2 * sqrt(stiffness * mass)`.
0 commit comments