Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
},
"peerDependencies": {
"react": ">=16",
"react-native": "^0.60.5",
"react-native": "^0.62.0",
"react-native-gesture-handler": "^1.4.1",
"react-native-reanimated": "^1.2.0"
"react-native-reanimated": "^2.2.0"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -53,9 +53,9 @@
"pretty-quick": "^1.11.1",
"react": "^16.11.0",
"react-dom": "^16.9.0",
"react-native": "^0.60.5",
"react-native": "^0.62.0",
"react-native-gesture-handler": "^1.4.1",
"react-native-reanimated": "^1.3.0",
"react-native-reanimated": "^2.2.0",
"react-test-renderer": "^16.11.0",
"ts-jest": "^24.1.0",
"tsdx": "^0.9.1",
Expand Down
18 changes: 10 additions & 8 deletions src/pager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const {
greaterThan,
abs,
ceil,
interpolate,
interpolateNode,
concat,
neq,
and,
Expand Down Expand Up @@ -463,11 +463,13 @@ function Pager({
<Animated.View style={style || { flex: 1 }}>
<Animated.View style={{ flex: 1 }} onLayout={handleLayout}>
<Animated.View
style={{
flex: 1,
[targetDimension]: totalDimension,
transform: [{ [targetTransform]: containerTranslation }],
}}
style={
{
flex: 1,
[targetDimension]: totalDimension,
transform: [{ [targetTransform]: containerTranslation }],
} as Animated.AnimateStyle<ViewStyle>
}
>
{renderChildren()}
</Animated.View>
Expand Down Expand Up @@ -731,9 +733,9 @@ function interpolateWithConfig(
let _style;
const { unit, ...rest } = currentStyle;
if (currentStyle.unit) {
_style = concat(interpolate(offset, rest), currentStyle.unit);
_style = concat(interpolateNode(offset, rest), currentStyle.unit);
} else {
_style = interpolate(offset, currentStyle);
_style = interpolateNode(offset, currentStyle);
}

styles[key] = _style;
Expand Down
14 changes: 8 additions & 6 deletions src/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ function Slider({ numberOfScreens, style }: iSlider) {
return (
<Animated.View onLayout={handleLayout}>
<Animated.View
style={{
width: sliderWidth,
transform: [{ translateX: translation }],
...DEFAULT_SLIDER_STYLE,
...style,
}}
style={
{
width: sliderWidth,
transform: [{ translateX: translation }],
...DEFAULT_SLIDER_STYLE,
...style,
} as Animated.AnimateStyle<ViewStyle>
}
/>
</Animated.View>
);
Expand Down
6 changes: 3 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Animated from 'react-native-reanimated';
import { iPageInterpolation, SpringConfig } from './pager';

const {
interpolate,
interpolateNode,
concat,
Value,
clockRunning,
Expand Down Expand Up @@ -41,9 +41,9 @@ function interpolateWithConfig(
let _style;
const { unit, ...rest } = currentStyle;
if (currentStyle.unit) {
_style = concat(interpolate(offset, rest), currentStyle.unit);
_style = concat(interpolateNode(offset, rest), currentStyle.unit);
} else {
_style = interpolate(offset, currentStyle);
_style = interpolateNode(offset, currentStyle);
}

styles[key] = _style;
Expand Down
Loading