Skip to content

Commit

Permalink
Use Extrapolation enum instead of Animated.Extrapolate to support rea…
Browse files Browse the repository at this point in the history
…nimated v3 (#493)

Reanimated v3 removes the v1 implementation. The Animated.Extrapolate enum is part of what was removed. Instead there is the `Extrapolation` enum we can use. The only potential issue is it was only introduced in [email protected] (software-mansion/react-native-reanimated@cb651ec). Another potential solution to support both would be to use string literals instead of the enum.
  • Loading branch information
janicduplessis authored Jun 24, 2022
1 parent 0979c33 commit 72d4709
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Paths.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Animated, { interpolate } from "react-native-reanimated";
import { interpolate, Extrapolation } from "react-native-reanimated";
import parseSVG from "parse-svg-path";
import absSVG from "abs-svg-path";
import normalizeSVG from "normalize-svg-path";
Expand Down Expand Up @@ -77,7 +77,7 @@ export const interpolatePath = (
value: number,
inputRange: number[],
outputRange: Path[],
extrapolate = Animated.Extrapolate.CLAMP
extrapolate = Extrapolation.CLAMP
) => {
"worklet";
const path = {
Expand Down Expand Up @@ -152,7 +152,7 @@ export const mixPath = (
value: number,
p1: Path,
p2: Path,
extrapolate = Animated.Extrapolate.CLAMP
extrapolate = Extrapolation.CLAMP
) => {
"worklet";
return interpolatePath(value, [0, 1], [p1, p2], extrapolate);
Expand Down

0 comments on commit 72d4709

Please sign in to comment.