Skip to content

Commit

Permalink
Fix error caused by __createInterpolation being removed from react-na…
Browse files Browse the repository at this point in the history
…tive
  • Loading branch information
phamfoo committed Feb 27, 2024
1 parent 452aec0 commit c370a7c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/create-interpolation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ type ColorInterpolateFunction = (input: number) => string
function createInterpolation(
config: Animated.InterpolationConfigType
): ColorInterpolateFunction {
return AnimatedInterpolation.__createInterpolation(config)
if (AnimatedInterpolation.__createInterpolation) {
return AnimatedInterpolation.__createInterpolation(config)
}

return (input) => {
const interpolation = new AnimatedInterpolation(
{ __getValue: () => input },
config
)

return interpolation.__getValue()
}
}

export { createInterpolation }

0 comments on commit c370a7c

Please sign in to comment.