Skip to content

Commit 8a2549c

Browse files
Update dependencies to be compatible with react native 0.81 (#129)
1 parent f4ca4ed commit 8a2549c

19 files changed

Lines changed: 4377 additions & 4303 deletions

File tree

apps/docs/next.config.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export default withNextra({
8282
'react-native-gesture-handler',
8383
'react-native-picker-select',
8484
'react-native-reanimated',
85+
'react-native-worklets',
8586
'react-native-tab-view',
8687
'recyclerlistview',
8788
'@gorhom/bottom-sheet',
@@ -104,7 +105,14 @@ export default withNextra({
104105
'.web.tsx',
105106
...config.resolve.extensions,
106107
];
107-
config.plugins.push(new webpack.DefinePlugin({ __DEV__: isDevelopment, }));
108+
config.plugins.push(
109+
new webpack.DefinePlugin({
110+
__DEV__: isDevelopment,
111+
// Polyfill 'global' for packages like @gorhom/bottom-sheet that expect Node.js/React Native environment
112+
global: 'globalThis',
113+
})
114+
);
115+
108116
return config;
109117
},
110118
});

apps/docs/package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
"next": "15.3.3",
2121
"nextra": "2.13.4",
2222
"nextra-theme-docs": "2.13.4",
23-
"react": "^18.2.0",
24-
"react-dom": "^18.2.0",
23+
"react": "19.1.0",
24+
"react-dom": "19.1.0",
2525
"react-icons": "^5.3.0",
2626
"react-intersection-observer": "^8.26.2",
2727
"react-live": "^4.1.7",
2828
"react-native-ficus-ui": "workspace:*",
29-
"react-native-gesture-handler": "2.20.2",
30-
"react-native-reanimated": "3.16.1",
31-
"react-native-web": "0.19.12"
29+
"react-native-gesture-handler": "2.28.0",
30+
"react-native-reanimated": "4.1.6",
31+
"react-native-web": "0.21.2"
3232
},
3333
"dependenciesMeta": {
3434
"nextra": {
@@ -47,7 +47,7 @@
4747
"babel-loader": "^9.1.3",
4848
"postcss": "^8.4.31",
4949
"tailwindcss": "^3.3.3",
50-
"typescript": "5.3.3",
50+
"typescript": "5.9.3",
5151
"webpack": "^5.95.0"
5252
},
5353
"nextBundleAnalysis": {
@@ -57,7 +57,10 @@
5757
},
5858
"pnpm": {
5959
"overrides": {
60-
"react-native": "npm:react-native-web"
60+
"react-native": "npm:react-native-web",
61+
"react": "19.1.0",
62+
"react-dom": "19.1.0",
63+
"use-latest-callback": "0.2.3"
6164
}
6265
}
6366
}

apps/examples/metro.config.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const { getDefaultConfig } = require('expo/metro-config');
22
const path = require('path');
3-
const exclusionList = require('metro-config/src/defaults/exclusionList');
43
const escape = require('escape-string-regexp');
54
const pak = require('./package.json');
65

@@ -15,8 +14,8 @@ const modules = [
1514
...Object.keys(pak.peerDependencies ?? {}),
1615
];
1716

18-
// 🔁 Use `blockList` instead of deprecated `blacklistRE`
19-
config.resolver.blockList = exclusionList([
17+
// ---- blockList (sans exclusionList) ----
18+
const customBlockList = [
2019
// Block test files
2120
new RegExp(`${escape(libRoot)}.*\\.(spec|test)\\.[jt]sx?$`),
2221

@@ -26,13 +25,22 @@ config.resolver.blockList = exclusionList([
2625
path.resolve(workspaceRoot, 'node_modules/@testing-library/react-native')
2726
)}\\/.*`
2827
),
29-
new RegExp(
30-
`${escape(
31-
path.resolve(libRoot, 'src/test-utils')
32-
)}\\/.*`
33-
),
34-
]);
3528

29+
// Block test utils inside the lib
30+
new RegExp(`${escape(path.resolve(libRoot, 'src/test-utils'))}\\/.*`),
31+
];
32+
33+
// Normalise la blockList par défaut en tableau puis concatène
34+
const defaultBlockList = config.resolver?.blockList;
35+
const defaultAsArray = Array.isArray(defaultBlockList)
36+
? defaultBlockList
37+
: defaultBlockList
38+
? [defaultBlockList]
39+
: [];
40+
41+
config.resolver.blockList = [...defaultAsArray, ...customBlockList];
42+
43+
// ---- monorepo/watch ----
3644
config.watchFolders = [libRoot];
3745

3846
config.resolver.nodeModulesPaths = [

apps/examples/package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,34 @@
1717
"preset": "jest-expo"
1818
},
1919
"dependencies": {
20-
"@expo/vector-icons": "14.0.2",
21-
"expo": "52.0.0-preview.7",
22-
"expo-constants": "17.0.2",
23-
"expo-font": "13.0.0",
24-
"expo-linking": "7.0.2",
25-
"expo-modules-autolinking": "2.1.10",
26-
"expo-router": "4.0.0-preview.4",
27-
"expo-splash-screen": "0.28.4",
28-
"expo-status-bar": "2.0.0",
29-
"expo-system-ui": "4.0.1",
30-
"expo-web-browser": "14.0.0",
31-
"react": "18.3.1",
32-
"react-dom": "18.3.1",
33-
"react-native": "0.76.0",
20+
"@expo/vector-icons": "15.0.3",
21+
"expo": "54.0.31",
22+
"expo-constants": "18.0.13",
23+
"expo-font": "14.0.10",
24+
"expo-linking": "8.0.11",
25+
"expo-router": "6.0.21",
26+
"expo-splash-screen": "31.0.13",
27+
"expo-status-bar": "3.0.9",
28+
"expo-system-ui": "6.0.9",
29+
"expo-web-browser": "15.0.10",
30+
"react": "19.1.0",
31+
"react-dom": "19.1.0",
32+
"react-native": "0.81.5",
3433
"react-native-ficus-ui": "workspace:*",
35-
"react-native-gesture-handler": "2.26.0",
36-
"react-native-reanimated": "3.16.1",
37-
"react-native-web": "0.19.13"
34+
"react-native-gesture-handler": "2.28.0",
35+
"react-native-reanimated": "4.1.6",
36+
"react-native-web": "0.21.2",
37+
"react-native-worklets": "0.5.1"
3838
},
3939
"devDependencies": {
4040
"@babel/core": "^7.20.0",
41-
"@types/jest": "29.5.12",
42-
"@types/react": "18.3.12",
41+
"@types/jest": "29.5.14",
42+
"@types/react": "~19.1.17",
4343
"@types/react-test-renderer": "18.0.7",
4444
"babel-plugin-module-resolver": "5.0.2",
45-
"jest": "29.2.1",
46-
"jest-expo": "52.0.0-preview.1",
45+
"jest": "29.7.0",
46+
"jest-expo": "54.0.16",
4747
"react-test-renderer": "18.2.0",
48-
"typescript": "5.3.3"
48+
"typescript": "5.9.3"
4949
}
5050
}

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
'|react-native-confirmation-code-field' +
1313
'|react-native-picker-select' +
1414
'|react-native-tab-view' +
15+
'|react-native-pager-view' +
1516
'|react-native-vector-icons' +
1617
'|react-native-modal' +
1718
'|react-native-animatable' +

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-ficus-ui-monorepo",
33
"private": true,
4-
"version": "2.3.1",
4+
"version": "2.4.0",
55
"engines": {
66
"node": ">= 22.0.0"
77
},
@@ -36,12 +36,14 @@
3636
"license": "MIT",
3737
"pnpm": {
3838
"overrides": {
39-
"react": "18.3.1",
40-
"react-native": "0.76.0",
41-
"react-dom": "18.3.1",
42-
"@types/react": "18.3.1",
43-
"@types/react-dom": "18.3.1",
44-
"react-native-tab-view>use-latest-callback": "0.2.3"
39+
"react": "19.1.0",
40+
"react-native": "0.81.5",
41+
"react-dom": "19.1.0",
42+
"@types/react": "~19.1.10",
43+
"@types/react-dom": "19.1.0",
44+
"use-latest-callback": "0.2.3",
45+
"react-native-screens": "4.16.0",
46+
"@headlessui/react": "2.2.0"
4547
}
4648
},
4749
"packageManager": "pnpm@9.15.5"

packages/react-native-ficus-ui/package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "module",
33
"name": "react-native-ficus-ui",
4-
"version": "2.3.1",
4+
"version": "2.4.0",
55
"contributors": [
66
{
77
"name": "Nicolas Torion",
@@ -62,7 +62,7 @@
6262
},
6363
"dependencies": {
6464
"@chakra-ui/utils": "2.2.2",
65-
"@gorhom/bottom-sheet": "5.0.4",
65+
"@gorhom/bottom-sheet": "5.2.8",
6666
"@react-native-community/slider": "4.5.4",
6767
"@react-native-picker/picker": "2.11.0",
6868
"@react-native/babel-preset": "0.80.0",
@@ -72,18 +72,18 @@
7272
"deepmerge": "4.2.2",
7373
"eslint": "8.57.0",
7474
"prettier": "3.4.2",
75-
"react": "18.3.1",
76-
"react-dom": "18.3.1",
75+
"react": "19.1.0",
76+
"react-dom": "19.1.0",
7777
"react-fast-compare": "3.2.2",
7878
"react-native-builder-bob": "0.40.11",
7979
"react-native-confirmation-code-field": "7.4.0",
80-
"react-native-modal": "13.0.1",
81-
"react-native-pager-view": "6.5.1",
80+
"react-native-modal": "14.0.0-rc.1",
81+
"react-native-pager-view": "8.0.0",
8282
"react-native-picker-select": "9.3.1",
8383
"react-native-tab-view": "3.5.2",
8484
"react-native-toast-message": "2.1.6",
8585
"react-native-vector-icons": "10.2.0",
86-
"react-test-renderer": "18.2.0",
86+
"react-test-renderer": "19.1.0",
8787
"validate-color": "2.2.4"
8888
},
8989
"devDependencies": {
@@ -101,8 +101,8 @@
101101
"del-cli": "6.0.0",
102102
"eslint-plugin-testing-library": "7.5.3",
103103
"metro-react-native-babel-preset": "0.77.0",
104-
"react": "18.3.1",
105-
"react-native": "0.76.0",
104+
"react": "19.1.0",
105+
"react-native": "0.81.5",
106106
"turbo": "2.4.2"
107107
},
108108
"peerDependencies": {
@@ -118,8 +118,9 @@
118118
"pnpm": {
119119
"overrides": {
120120
"react": "18.3.1",
121-
"react-native": "0.76.0",
122121
"react-dom": "18.3.1",
122+
"react-native": "0.76.0",
123+
"react-native-screens": "4.16.0",
123124
"@types/react": "18.3.1",
124125
"@types/react-dom": "18.3.1"
125126
}

packages/react-native-ficus-ui/src/components/avatar/avatar-group.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React, { type ReactElement, cloneElement, isValidElement } from 'react';
22

3+
import type { AvatarProps } from './avatar';
4+
35
import { compact } from '@chakra-ui/utils';
46

57
import {
@@ -39,7 +41,7 @@ export const AvatarGroup = forwardRef<AvatarGroupProps, 'View'>(
3941
*/
4042
const avatarChildren = React.Children.toArray(children).filter(
4143
(element) => isValidElement(element) && element.type === Avatar
42-
) as ReactElement[];
44+
) as ReactElement<AvatarProps>[];
4345

4446
const truncatedChildren =
4547
max != null ? avatarChildren.slice(0, max) : avatarChildren;
@@ -50,15 +52,15 @@ export const AvatarGroup = forwardRef<AvatarGroupProps, 'View'>(
5052
const clones = reversedChildren.map((child, index) => {
5153
const isFirstAvatar = index === 0;
5254

53-
const childProps: SystemStyleObject = {
55+
const childProps = {
5456
ml: isFirstAvatar ? 0 : '-lg',
5557
borderWidth: 3,
5658
borderColor,
5759
borderRadius,
5860
size: child?.props.size ? child.props.size : props.size,
5961
};
6062

61-
return cloneElement(child, compact(childProps));
63+
return cloneElement(child, compact(childProps) as Partial<AvatarProps>);
6264
});
6365

6466
const groupStyles: SystemStyleObject = {

packages/react-native-ficus-ui/src/components/avatar/avatar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ export const Avatar = forwardRef<AvatarProps, 'View'>(
6868
* To avoid using a context, we clone the element and apply the style retrieved with the `useMultiStyleConfig`
6969
*/}
7070
{React.Children.map(children as any, (child: React.ReactElement) => {
71+
const childProps = child.props as Record<string, any>;
7172
return React.cloneElement(child, {
7273
__styles: {
7374
...styles.badge,
74-
...child.props.__styles,
75+
...childProps.__styles,
7576
},
7677
size: props.size ?? styles.container?.width,
77-
});
78+
} as Record<string, any>);
7879
})}
7980
</ficus.View>
8081
);

packages/react-native-ficus-ui/src/components/button/button.service.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ function applyColorToChild(
2626
): React.ReactNode {
2727
if (!React.isValidElement(child)) return child;
2828

29+
const existingProps = child.props as Record<string, any>;
2930
// If it's a primitive element like <Icon />, inject color or styles
3031
const childProps = {
31-
...(child.props || {}),
32-
color: child.props?.color || styles?.color,
32+
...existingProps,
33+
color: existingProps?.color || styles?.color,
3334
};
3435

3536
return React.cloneElement(child, childProps);

0 commit comments

Comments
 (0)