Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.

Commit 9ab3e06

Browse files
authored
chore: upgrade to expo 47 and latest pager-view (#1404)
1 parent 703f148 commit 9ab3e06

File tree

10 files changed

+1148
-909
lines changed

10 files changed

+1148
-909
lines changed

example/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
"dependencies": {
1313
"@expo/vector-icons": "^13.0.0",
1414
"@react-native-async-storage/async-storage": "~1.17.3",
15-
"expo": "^46.0.0",
16-
"expo-asset": "~8.6.1",
17-
"expo-constants": "~13.2.3",
18-
"expo-keep-awake": "~10.2.0",
19-
"expo-updates": "^0.14.5",
20-
"react": "18.0.0",
21-
"react-dom": "18.0.0",
22-
"react-native": "0.69.5",
23-
"react-native-pager-view": "5.4.25",
24-
"react-native-safe-area-context": "4.3.1",
25-
"react-native-web": "~0.18.7",
15+
"expo": "^47.0.0",
16+
"expo-asset": "~8.6.2",
17+
"expo-constants": "~14.0.2",
18+
"expo-keep-awake": "~11.0.1",
19+
"expo-updates": "~0.15.4",
20+
"react": "18.1.0",
21+
"react-dom": "18.1.0",
22+
"react-native": "0.70.5",
23+
"react-native-pager-view": "6.1.0",
24+
"react-native-safe-area-context": "4.4.1",
25+
"react-native-web": "~0.18.9",
2626
"use-latest-callback": "^0.1.5"
2727
},
2828
"devDependencies": {
2929
"babel-plugin-module-resolver": "^4.1.0",
30-
"babel-preset-expo": "9.2.0",
31-
"expo-cli": "^6.0.5"
30+
"babel-preset-expo": "~9.2.1",
31+
"expo-cli": "^6.0.8"
3232
}
3333
}

example/src/CustomTabBarExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const CustomTabBarExample = () => {
4141
position,
4242
}: {
4343
navigationState: State;
44-
position: Animated.AnimatedInterpolation;
44+
position: Animated.AnimatedInterpolation<number>;
4545
}) =>
4646
({ route, index }: { route: Route; index: number }) => {
4747
const inputRange = navigationState.routes.map((_, i) => i);

example/yarn.lock

Lines changed: 667 additions & 501 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"@commitlint/config-conventional": "^17.1.0",
5151
"@expo/vector-icons": "^13.0.0",
5252
"@release-it/conventional-changelog": "^5.1.0",
53-
"@types/react": "^18.0.14",
54-
"@types/react-native": "0.69.5",
53+
"@types/react": "^18.0.24",
54+
"@types/react-native": "0.70.6",
5555
"babel-jest": "^29.0.1",
5656
"babel-loader": "^8.2.5",
5757
"babel-preset-react-native": "^4.0.0",
@@ -62,11 +62,11 @@
6262
"husky": "^4.2.5",
6363
"jest": "^29.0.1",
6464
"prettier": "^2.7.1",
65-
"react": "18.0.0",
66-
"react-native": "0.69.5",
67-
"react-native-builder-bob": "^0.19.1",
68-
"react-native-pager-view": "5.4.24",
69-
"release-it": "^15.4.0",
65+
"react": "18.1.0",
66+
"react-native": "0.70.5",
67+
"react-native-builder-bob": "^0.20.1",
68+
"react-native-pager-view": "6.1.0",
69+
"release-it": "^15.5.0",
7070
"typescript": "^4.8.2"
7171
},
7272
"peerDependencies": {

src/PagerViewAdapter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Props<T extends Route> = PagerProps & {
2121
props: EventEmitterProps & {
2222
// Animated value which represents the state of current index
2323
// It can include fractional digits as it represents the intermediate value
24-
position: Animated.AnimatedInterpolation;
24+
position: Animated.AnimatedInterpolation<number>;
2525
// Function to actually render the content of the pager
2626
// The parent component takes care of rendering
2727
render: (children: React.ReactNode) => React.ReactNode;

src/PanResponderAdapter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Props<T extends Route> = PagerProps & {
2727
props: EventEmitterProps & {
2828
// Animated value which represents the state of current index
2929
// It can include fractional digits as it represents the intermediate value
30-
position: Animated.AnimatedInterpolation;
30+
position: Animated.AnimatedInterpolation<number>;
3131
// Function to actually render the content of the pager
3232
// The parent component takes care of rendering
3333
render: (children: React.ReactNode) => React.ReactNode;

src/TabBarIndicator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type Props<T extends Route> = SceneRendererProps & {
2323
};
2424

2525
const getTranslateX = (
26-
position: Animated.AnimatedInterpolation,
26+
position: Animated.AnimatedInterpolation<number>,
2727
routes: Route[],
2828
getTabWidth: GetTabWidth,
2929
gap?: number

src/TabBarItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import PlatformPressable from './PlatformPressable';
1313
import type { Scene, Route, NavigationState } from './types';
1414

1515
export type Props<T extends Route> = {
16-
position: Animated.AnimatedInterpolation;
16+
position: Animated.AnimatedInterpolation<number>;
1717
route: T;
1818
navigationState: NavigationState<T>;
1919
activeColor?: string;
@@ -47,7 +47,7 @@ const DEFAULT_ACTIVE_COLOR = 'rgba(255, 255, 255, 1)';
4747
const DEFAULT_INACTIVE_COLOR = 'rgba(255, 255, 255, 0.7)';
4848

4949
const getActiveOpacity = (
50-
position: Animated.AnimatedInterpolation,
50+
position: Animated.AnimatedInterpolation<number>,
5151
routesLength: number,
5252
tabIndex: number
5353
) => {
@@ -64,7 +64,7 @@ const getActiveOpacity = (
6464
};
6565

6666
const getInactiveOpacity = (
67-
position: Animated.AnimatedInterpolation,
67+
position: Animated.AnimatedInterpolation<number>,
6868
routesLength: number,
6969
tabIndex: number
7070
) => {

src/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export type Listener = (value: number) => void;
3333

3434
export type SceneRendererProps = {
3535
layout: Layout;
36-
position: Animated.AnimatedInterpolation;
36+
position: Animated.AnimatedInterpolation<number>;
3737
jumpTo: (key: string) => void;
3838
};
3939

0 commit comments

Comments
 (0)