Skip to content

Commit d75825b

Browse files
authored
chore: upgrade example app to expo 46 & update dependencies (#3446)
1 parent 22f1d42 commit d75825b

File tree

19 files changed

+3316
-4626
lines changed

19 files changed

+3316
-4626
lines changed

example/package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@
1313
"main": "node_modules/expo/AppEntry.js",
1414
"dependencies": {
1515
"@expo/vector-icons": "^13.0.0",
16-
"@react-native-async-storage/async-storage": "~1.17.3",
17-
"@react-native-community/masked-view": "0.1.10",
18-
"@react-navigation/drawer": "^6.1.8",
19-
"@react-navigation/native": "^6.0.7",
20-
"@react-navigation/stack": "^6.1.1",
21-
"expo": "^45.0.0",
22-
"expo-font": "~10.1.0",
23-
"expo-keep-awake": "~10.1.1",
24-
"expo-splash-screen": "~0.15.1",
25-
"expo-status-bar": "~1.3.0",
26-
"expo-updates": "~0.13.2",
27-
"file-loader": "^4.0.0",
28-
"react": "17.0.2",
29-
"react-dom": "17.0.2",
30-
"react-native": "0.68.2",
31-
"react-native-gesture-handler": "~2.2.1",
32-
"react-native-reanimated": "~2.8.0",
33-
"react-native-safe-area-context": "4.2.4",
34-
"react-native-screens": "~3.11.1",
35-
"react-native-vector-icons": "^9.1.0",
36-
"react-native-web": "0.17.7",
37-
"typeface-roboto": "^0.0.54"
16+
"@react-native-async-storage/async-storage": "~1.17.10",
17+
"@react-native-community/masked-view": "^0.1.11",
18+
"@react-navigation/drawer": "^6.5.0",
19+
"@react-navigation/native": "^6.0.13",
20+
"@react-navigation/stack": "^6.3.3",
21+
"expo": "^46.0.0",
22+
"expo-font": "~10.2.0",
23+
"expo-keep-awake": "~10.2.0",
24+
"expo-splash-screen": "~0.16.2",
25+
"expo-status-bar": "~1.4.0",
26+
"expo-updates": "~0.14.6",
27+
"file-loader": "^6.2.0",
28+
"react": "18.0.0",
29+
"react-dom": "18.0.0",
30+
"react-native": "0.69.6",
31+
"react-native-gesture-handler": "~2.5.0",
32+
"react-native-reanimated": "~2.9.1",
33+
"react-native-safe-area-context": "4.3.1",
34+
"react-native-screens": "~3.15.0",
35+
"react-native-vector-icons": "^9.2.0",
36+
"react-native-web": "~0.18.7",
37+
"typeface-roboto": "^1.1.13"
3838
},
3939
"devDependencies": {
40-
"babel-plugin-module-resolver": "^4.0.0",
41-
"babel-preset-expo": "~9.1.0",
42-
"expo-cli": "^5.0.3"
40+
"babel-plugin-module-resolver": "^4.1.0",
41+
"babel-preset-expo": "~9.2.0",
42+
"expo-cli": "^6.0.6"
4343
}
4444
}

example/src/Examples/AnimatedFABExample/CustomFABControls.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { FlatList, StyleSheet, View } from 'react-native';
2+
import { FlatList, ListRenderItemInfo, StyleSheet, View } from 'react-native';
33

44
import { TouchableOpacity } from 'react-native-gesture-handler';
55
import type {
@@ -43,7 +43,7 @@ const CustomControl = ({
4343
const { isV3 } = useExampleTheme();
4444

4545
const _renderItem = React.useCallback(
46-
({ item }) => {
46+
({ item }: ListRenderItemInfo<typeof options[number]>) => {
4747
const TextComponent = isV3 ? Text : Paragraph;
4848

4949
return (
@@ -64,7 +64,10 @@ const CustomControl = ({
6464
[value, onChange, isV3]
6565
);
6666

67-
const _keyExtractor = React.useCallback((item) => item, []);
67+
const _keyExtractor = React.useCallback(
68+
(item: typeof options[number]) => item,
69+
[]
70+
);
6871
const TextComponent = isV3 ? Text : Paragraph;
6972

7073
return (

example/yarn.lock

Lines changed: 2381 additions & 3586 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,22 @@
5151
"react-native-iphone-x-helper": "^1.3.1"
5252
},
5353
"devDependencies": {
54-
"@babel/core": "^7.17.0",
55-
"@babel/runtime": "^7.10.3",
54+
"@babel/core": "^7.19.6",
55+
"@babel/runtime": "^7.20.0",
5656
"@callstack/eslint-config": "^13.0.1",
5757
"@commitlint/config-conventional": "^8.3.4",
5858
"@release-it/conventional-changelog": "^1.1.0",
5959
"@testing-library/jest-native": "^4.0.11",
60-
"@testing-library/react-native": "11.0.0",
60+
"@testing-library/react-native": "11.3.0",
6161
"@types/color": "^3.0.0",
6262
"@types/jest": "^24.0.13",
6363
"@types/node": "^13.1.0",
64-
"@types/react-dom": "^16.8.4",
65-
"@types/react-native": "^0.66.1",
64+
"@types/react-dom": "^18.0.8",
65+
"@types/react-native": "^0.70.6",
6666
"@types/react-native-vector-icons": "^6.4.1",
67-
"@typescript-eslint/eslint-plugin": "^5.36.2",
68-
"@typescript-eslint/parser": "^5.36.2",
69-
"all-contributors-cli": "^6.1.1",
67+
"@typescript-eslint/eslint-plugin": "^5.41.0",
68+
"@typescript-eslint/parser": "^5.41.0",
69+
"all-contributors-cli": "^6.24.0",
7070
"babel-cli": "^6.26.0",
7171
"babel-core": "^7.0.0-bridge.0",
7272
"babel-jest": "^26.1.0",
@@ -76,24 +76,24 @@
7676
"commitlint": "^8.3.4",
7777
"conventional-changelog-cli": "^2.0.11",
7878
"dedent": "^0.7.0",
79-
"eslint": "8.22.0",
79+
"eslint": "8.26.0",
8080
"eslint-plugin-flowtype": "^8.0.3",
8181
"expo-constants": "^9.3.5",
8282
"flow-bin": "0.92.0",
8383
"glob": "^7.1.3",
8484
"husky": "^1.3.1",
8585
"jest": "^26.1.0",
8686
"jest-file-snapshot": "^0.3.2",
87-
"metro-react-native-babel-preset": "^0.67.0",
88-
"react": "17.0.2",
89-
"react-dom": "17.0.2",
90-
"react-native": "0.68.2",
87+
"metro-react-native-babel-preset": "0.70.3",
88+
"react": "18.0.0",
89+
"react-dom": "18.0.0",
90+
"react-native": "0.69.6",
9191
"react-native-builder-bob": "^0.17.1",
92-
"react-native-vector-icons": "^9.1.0",
93-
"react-test-renderer": "16.13.1",
92+
"react-native-vector-icons": "9.2.0",
93+
"react-test-renderer": "18.0.0",
9494
"release-it": "^13.4.0",
9595
"rimraf": "^3.0.2",
96-
"typescript": "4.5.4"
96+
"typescript": "4.8.4"
9797
},
9898
"peerDependencies": {
9999
"react": "*",

src/components/Appbar/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ type RenderAppbarContentProps = {
4949
isDark: boolean;
5050
shouldCenterContent?: boolean;
5151
isV3: boolean;
52-
renderOnly?: React.ReactNode[];
53-
renderExcept?: React.ReactNode[];
52+
renderOnly?: React.ComponentType<any>[];
53+
renderExcept?: React.ComponentType<any>[];
5454
mode?: AppbarModes;
5555
};
5656

@@ -81,7 +81,7 @@ export const renderAppbarContent = ({
8181
mode = 'small',
8282
}: RenderAppbarContentProps) => {
8383
return (
84-
React.Children.toArray(children)
84+
React.Children.toArray(children as React.ReactNode | React.ReactNode[])
8585
.filter((child) => child != null && typeof child !== 'boolean')
8686
.filter((child) =>
8787
// @ts-expect-error: TypeScript complains about the type of type but it doesn't matter

src/components/BottomNavigation/BottomNavigationRouteScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { Animated, Platform, View, ViewProps } from 'react-native';
33

44
interface Props extends ViewProps {
5-
visibility?: 0 | 1 | Animated.AnimatedInterpolation;
5+
visibility?: 0 | 1 | Animated.AnimatedInterpolation<number>;
66
index: number;
77
}
88

src/components/Card/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ const Card = ({
265265
<View style={styles.innerContainer}>
266266
{React.Children.map(children, (child, index) =>
267267
React.isValidElement(child)
268-
? React.cloneElement(child, {
268+
? React.cloneElement(child as React.ReactElement<any>, {
269269
index,
270270
total,
271271
siblings,

src/components/Card/CardActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const CardActions = (props: Props) => {
4848
>
4949
{React.Children.map(props.children, (child, i) => {
5050
return React.isValidElement(child)
51-
? React.cloneElement(child, {
51+
? React.cloneElement(child as React.ReactElement<any>, {
5252
compact: !isV3 && child.props.compact !== false,
5353
mode:
5454
child.props.mode ||

src/components/Chip/Chip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ const Chip = ({
280280
]}
281281
>
282282
{React.isValidElement(avatar)
283-
? React.cloneElement(avatar, {
283+
? React.cloneElement(avatar as React.ReactElement<any>, {
284284
style: [styles.avatar, avatar.props.style],
285285
})
286286
: avatar}

src/components/Dialog/Dialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const Dialog = ({
122122
.map((child, i) => {
123123
if (isV3) {
124124
if (i === 0 && React.isValidElement(child)) {
125-
return React.cloneElement(child, {
125+
return React.cloneElement(child as React.ReactElement<any>, {
126126
style: [{ marginTop: 24 }, child.props.style],
127127
});
128128
}
@@ -134,7 +134,7 @@ const Dialog = ({
134134
child.type === DialogContent
135135
) {
136136
// Dialog content is the first item, so we add a top padding
137-
return React.cloneElement(child, {
137+
return React.cloneElement(child as React.ReactElement<any>, {
138138
style: [{ paddingTop: 24 }, child.props.style],
139139
});
140140
}

0 commit comments

Comments
 (0)