Skip to content

Commit c505643

Browse files
authored
chore: Update react-native to 0.82 (#4842)
* chore: Update RN to 0.82 and Example App Expo version to 54 (WIP) * chore: Fixed BackHandler and some unit tests * chore: Missing unit tests update * chore: updated worklets * chore: removed patch-package * chore: package.json re-arrangement and small typescript issues fixed * fix: applied menu fix for 0.81 * fix: Added missing yarn.lock changes * fix: Docs * fix: Docs build fix * fix: Adjusted node version and removed latest changes
1 parent ff0df54 commit c505643

32 files changed

+4710
-6198
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
executors:
44
default:
55
docker:
6-
- image: cimg/node:18.20.2
6+
- image: cimg/node:20.19.0
77
working_directory: ~/react-native-paper
88

99
commands:

docs/src/components/DynamicColorTheme.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState, ReactNode } from 'react';
22

33
import Color from 'color';
44
//@ts-ignore
5+
// eslint-disable-next-line import/no-unresolved
56
import { BlockPicker } from 'react-color';
67

78
import Switch from './Switch';

docs/src/components/ScreenshotTabs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { ReactNode } from 'react';
22

33
//@ts-ignore
44
import TabItem from '@theme/TabItem';
@@ -21,7 +21,7 @@ const ScreenshotTabs: React.FC<ScreenshotTabsProps> = ({
2121
screenshotData,
2222
baseUrl,
2323
}) => {
24-
const renderScreenhot = (src: string): JSX.Element => (
24+
const renderScreenhot = (src: string): ReactNode => (
2525
<img src={`${baseUrl}${src}`} className={getClassName(src)} />
2626
);
2727

docs/src/components/ThemeColorsTable.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { ReactNode } from 'react';
22

33
//@ts-ignore
44
import Admonition from '@theme/Admonition';
@@ -13,11 +13,11 @@ import {
1313
getUniqueNestedKeys,
1414
} from '../utils/themeColors';
1515

16-
const getTableHeader = (keys: string[]): JSX.Element[] => {
16+
const getTableHeader = (keys: string[]): ReactNode[] => {
1717
return keys.map((key) => <th key={key}>{key}</th>);
1818
};
1919

20-
const getTableCell = (keys: string[], modes: DataObject): JSX.Element[] => {
20+
const getTableCell = (keys: string[], modes: DataObject): ReactNode[] => {
2121
return keys.map((key) => {
2222
const value = modes[key];
2323
if (typeof value === 'string') {
@@ -33,7 +33,7 @@ const FlatTable = ({
3333
}: {
3434
themeColorsData: DataObject;
3535
uniqueKeys: string[];
36-
}): JSX.Element => {
36+
}): ReactNode => {
3737
const rows = Object.keys(themeColorsData).map((mode) => {
3838
return (
3939
<tr key={`${mode}`}>
@@ -68,7 +68,7 @@ const TabbedTable = ({
6868
}: {
6969
themeColorsData: DataObject;
7070
uniqueKeys: string[];
71-
}): JSX.Element => {
71+
}): ReactNode => {
7272
const tabTableContent = Object.keys(themeColorsData).map((key) => {
7373
const modes = themeColorsData[key] as DataObject;
7474
const rows = Object.keys(modes).map((mode) => {
@@ -111,7 +111,7 @@ const ThemeColorsTable = ({
111111
}: {
112112
themeColorsData: DataObject;
113113
componentName: string;
114-
}): JSX.Element | null => {
114+
}): ReactNode | null => {
115115
const uniqueKeys = getUniqueNestedKeys(themeColorsData);
116116
const nestingLevel = getMaxNestedLevel(themeColorsData);
117117
const isFlatTable = nestingLevel === 1;

docs/src/utils/themes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
argbFromHex,
33
themeFromSourceColor,
4-
//@ts-ignore
4+
// eslint-disable-next-line import/no-unresolved
55
} from '@material/material-color-utilities';
66
import camelCase from 'camelcase';
77
import Color from 'color';

example/package.json

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,43 @@
1414
"web": "EXPO_NO_TYPESCRIPT_SETUP=1 expo start --web"
1515
},
1616
"dependencies": {
17-
"@expo/vector-icons": "^14.1.0",
17+
"@expo/vector-icons": "^15.0.2",
1818
"@expo/webpack-config": "~19.0.1",
1919
"@pchmn/expo-material3-theme": "^1.3.2",
20-
"@react-native-async-storage/async-storage": "1.23.1",
20+
"@react-native-async-storage/async-storage": "2.2.0",
2121
"@react-native-masked-view/masked-view": "0.3.2",
2222
"@react-navigation/bottom-tabs": "^7.3.10",
2323
"@react-navigation/drawer": "^7.3.9",
2424
"@react-navigation/native": "^7.1.6",
2525
"@react-navigation/stack": "^7.2.10",
26-
"expo": "~52.0.46",
27-
"expo-crypto": "~14.0.2",
28-
"expo-dev-client": "~5.0.20",
29-
"expo-font": "~13.0.4",
30-
"expo-keep-awake": "~14.0.3",
31-
"expo-splash-screen": "~0.29.24",
32-
"expo-status-bar": "~2.0.1",
33-
"expo-updates": "~0.27.4",
26+
"expo": "^54.0.0",
27+
"expo-crypto": "~15.0.7",
28+
"expo-dev-client": "~6.0.14",
29+
"expo-font": "~14.0.9",
30+
"expo-keep-awake": "~15.0.7",
31+
"expo-splash-screen": "~31.0.10",
32+
"expo-status-bar": "~3.0.8",
33+
"expo-updates": "~29.0.12",
3434
"file-loader": "^6.2.0",
35-
"react": "18.3.1",
36-
"react-dom": "18.3.1",
37-
"react-native": "0.77.2",
38-
"react-native-gesture-handler": "~2.22.0",
35+
"react": "19.1.0",
36+
"react-dom": "19.1.0",
37+
"react-native": "0.81.4",
38+
"react-native-gesture-handler": "~2.28.0",
3939
"react-native-monorepo-config": "^0.1.6",
40-
"react-native-reanimated": "~3.16.7",
41-
"react-native-safe-area-context": "5.1.0",
42-
"react-native-screens": "~4.8.0",
43-
"react-native-web": "~0.19.13",
40+
"react-native-reanimated": "~4.1.1",
41+
"react-native-safe-area-context": "~5.6.0",
42+
"react-native-screens": "~4.16.0",
43+
"react-native-web": "^0.21.0",
44+
"react-native-worklets": "0.5.1",
4445
"typeface-roboto": "^1.1.13"
4546
},
4647
"devDependencies": {
4748
"@babel/core": "^7.25.2",
4849
"babel-plugin-module-resolver": "^5.0.0",
49-
"babel-preset-expo": "~12.0.0",
50+
"babel-preset-expo": "~54.0.0",
5051
"url-loader": "^4.1.1"
5152
},
5253
"engines": {
53-
"node": ">=18"
54+
"node": ">=20"
5455
}
5556
}

example/src/Examples/AnimatedFABExample/CustomFAB.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import React from 'react';
2-
import {
3-
Animated,
4-
Platform,
5-
StyleProp,
6-
StyleSheet,
7-
ViewStyle,
8-
} from 'react-native';
2+
import { Animated, Platform, StyleSheet, ViewStyle } from 'react-native';
93

104
import { AnimatedFAB } from 'react-native-paper';
115

@@ -18,7 +12,7 @@ type CustomFABProps = {
1812
label: string;
1913
animateFrom: 'left' | 'right';
2014
iconMode?: 'static' | 'dynamic';
21-
style?: StyleProp<ViewStyle>;
15+
style?: ViewStyle;
2216
};
2317

2418
const CustomFAB = ({

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,17 @@
6262
"@callstack/eslint-config": "^13.0.2",
6363
"@commitlint/config-conventional": "^8.3.4",
6464
"@react-native-vector-icons/material-design-icons": "^12.0.0",
65+
"@react-native/babel-preset": "^0.82.1",
6566
"@react-navigation/native": "^6.1.2",
6667
"@release-it/conventional-changelog": "^1.1.0",
6768
"@testing-library/jest-native": "^5.4.1",
6869
"@testing-library/react-native": "11.5.0",
6970
"@types/color": "^3.0.0",
7071
"@types/jest": "^29.2.1",
7172
"@types/node": "^13.1.0",
72-
"@types/react-dom": "^18.3.1",
73+
"@types/react-dom": "^19.1.1",
7374
"@types/react-native-vector-icons": "^6.4.18",
74-
"@types/react-test-renderer": "^18.3.0",
75+
"@types/react-test-renderer": "^19.1.0",
7576
"@typescript-eslint/eslint-plugin": "^5.41.0",
7677
"@typescript-eslint/parser": "^5.41.0",
7778
"all-contributors-cli": "^6.24.0",
@@ -91,16 +92,15 @@
9192
"husky": "^1.3.1",
9293
"jest": "^29.6.3",
9394
"jest-file-snapshot": "^0.3.2",
94-
"metro-react-native-babel-preset": "0.73.9",
95-
"react": "18.3.1",
95+
"react": "19.1.1",
9696
"react-dom": "18.3.1",
97-
"react-native": "0.77.0",
97+
"react-native": "0.82.1",
9898
"react-native-builder-bob": "^0.21.3",
99-
"react-native-safe-area-context": "5.1.0",
100-
"react-test-renderer": "18.3.1",
99+
"react-native-safe-area-context": "5.5.2",
100+
"react-test-renderer": "19.1.1",
101101
"release-it": "^13.4.0",
102102
"rimraf": "^3.0.2",
103-
"typescript": "5.0.4"
103+
"typescript": "5.8.3"
104104
},
105105
"peerDependencies": {
106106
"react": "*",

src/components/BottomNavigation/BottomNavigationRouteScreen.tsx

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

44
interface Props extends ViewProps {
@@ -7,7 +7,7 @@ interface Props extends ViewProps {
77
}
88

99
class BottomNavigationRouteScreen extends React.Component<Props> {
10-
render(): JSX.Element {
10+
render(): ReactNode {
1111
const { style, index, children, visibility, ...rest } = this.props;
1212

1313
// On Web, the unfocused tab screens can still be clicked since they are transparent, but still there

src/components/Menu/Menu.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,9 @@ const Menu = ({
359359
easing: EASING,
360360
useNativeDriver: true,
361361
}),
362-
]).start(({ finished }) => {
363-
if (finished) {
364-
focusFirstDOMNode(menuRef.current);
365-
prevRendered.current = true;
366-
}
362+
]).start(() => {
363+
focusFirstDOMNode(menuRef.current);
364+
prevRendered.current = true;
367365
});
368366
}, [anchor, attachListeners, measureAnchorLayout, theme]);
369367

@@ -377,13 +375,11 @@ const Menu = ({
377375
duration: ANIMATION_DURATION * animation.scale,
378376
easing: EASING,
379377
useNativeDriver: true,
380-
}).start(({ finished }) => {
381-
if (finished) {
382-
setMenuLayout({ width: 0, height: 0 });
383-
setRendered(false);
384-
prevRendered.current = false;
385-
focusFirstDOMNode(anchorRef.current);
386-
}
378+
}).start(() => {
379+
setMenuLayout({ width: 0, height: 0 });
380+
setRendered(false);
381+
prevRendered.current = false;
382+
focusFirstDOMNode(anchorRef.current);
387383
});
388384
}, [removeListeners, theme]);
389385

0 commit comments

Comments
 (0)