Skip to content

Commit 2e68c68

Browse files
committed
Upgrade to React 19 and React Native 79
Ignore react-test-renderer deprecation warnings for now. Close #300
1 parent d745d1d commit 2e68c68

16 files changed

Lines changed: 15316 additions & 16017 deletions

apps/examples/metro.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,5 @@ const { getDefaultConfig } = require('expo/metro-config');
1212
const projectRoot = __dirname;
1313

1414
const config = getDefaultConfig(projectRoot);
15-
// 1. Enable Metro support for symlinks and package exports
16-
config.resolver.unstable_enablePackageExports = true;
17-
// 2. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
18-
config.resolver.disableHierarchicalLookup = true;
1915

2016
module.exports = config;

apps/examples/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
"dev:web": "expo start --web --clear"
1111
},
1212
"dependencies": {
13-
"@expo/metro-runtime": "~4.0.0",
14-
"expo": "^52.0.6",
15-
"expo-build-properties": "~0.13.1",
16-
"expo-status-bar": "~2.0.0",
13+
"@expo/metro-runtime": "~5.0.4",
14+
"expo": "^53.0.11",
15+
"expo-build-properties": "~0.14.6",
16+
"expo-status-bar": "~2.2.3",
1717
"postcss-react-strict-dom": "^0.0.5",
18-
"react": "~18.3.1",
19-
"react-dom": "~18.3.1",
20-
"react-native": "~0.76.1",
21-
"react-native-web": "~0.19.13",
18+
"react": "~19.0.0",
19+
"react-dom": "~19.0.0",
20+
"react-native": "~0.79.3",
21+
"react-native-web": "~0.20.0",
2222
"react-strict-dom": "*"
2323
},
2424
"devDependencies": {

apps/website/docs/learn/01-installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ npm install --save-dev postcss-react-strict-dom
3030

3131
### Native
3232

33-
For native support, please make sure the following peer dependencies are installed (note that using the new React Native architecture is required):
33+
For native support, please make sure the following peer dependencies are installed.
3434

3535
```
3636
npm install react react-native

apps/website/docs/learn/02-environment-setup.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ slug: /learn/setup
1010

1111
[Expo](https://expo.dev/) is a production-grade, cross-platform React framework that is the recommended solution for creating apps with React Strict DOM. The instructions in the rest of this guide are tailored to Expo, but can be adapted by readers to work with other frameworks.
1212

13-
Follow the Expo instructions on how to [create a new project](https://docs.expo.dev/get-started/create-a-project/). React Strict DOM requires use of the New React Native Architecture. Then follow the steps in the [Installation](/learn/installation) guide to install React Strict DOM.
13+
Follow the Expo instructions on how to [create a new project](https://docs.expo.dev/get-started/create-a-project/). React Strict DOM requires use of the latest Expo SDK with the New React Native Architecture enabled. Then follow the steps in the [Installation](/learn/installation) guide to install React Strict DOM.
1414

1515
A working example of an Expo setup with React Strict DOM can be found in this [examples app](https://github.com/facebook/react-strict-dom/tree/main/apps/examples).
1616

@@ -79,7 +79,7 @@ module.exports = {
7979
8080
## Metro configuration
8181
82-
[Metro](https://reactnative.dev/docs/metro) is the bundler used by Expo and React Native. It can bundle apps for native and web targets. Create or modify the `metro.config.js` file as follows to enable support for [package exports in React Native](https://reactnative.dev/blog/2023/06/21/package-exports-support). This step is not necessary for other packagers.
82+
[Metro](https://reactnative.dev/docs/metro) is the bundler used by Expo and React Native. It can bundle apps for native and web targets. Create the `metro.config.js` file as follows. Support for [package exports in React Native](https://reactnative.dev/blog/2023/06/21/package-exports-support) is now enabled by default. This step is not necessary for other packagers.
8383
8484
```js title="metro.config.js"
8585
// Learn more https://docs.expo.dev/guides/monorepos
@@ -89,22 +89,20 @@ const { getDefaultConfig } = require('expo/metro-config');
8989
const projectRoot = __dirname;
9090

9191
const config = getDefaultConfig(projectRoot);
92-
// 1. Enable Metro support for symlinks and package exports
93-
config.resolver.unstable_enablePackageExports = true;
94-
// 2. Only for npm monorepos: force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
95-
// config.resolver.disableHierarchicalLookup = true;
9692

9793
module.exports = config;
9894
```
9995
100-
TypeScript-based Expo projects should also set `moduleResolution` to `"bundler"`.
96+
TypeScript-based projects should set the following TypeScript compiler options:
10197
10298
```js title="tsconfig.json"
10399
{
104100
"extends": "expo/tsconfig.base",
105101
"compilerOptions": {
106-
"strict": true,
102+
"customConditions": ["react-native"],
107103
"moduleResolution": "bundler",
104+
"moduleSuffixes": [".ios", ".android", ".native", ""]
105+
"strict": true,
108106
},
109107
...
110108
}

apps/website/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
"serve": "docusaurus serve"
1010
},
1111
"dependencies": {
12-
"@docusaurus/core": "3.5.2",
13-
"@docusaurus/preset-classic": "3.5.2",
14-
"@mdx-js/react": "^3.0.0",
12+
"@docusaurus/core": "3.8.1",
13+
"@docusaurus/preset-classic": "3.8.1",
14+
"@mdx-js/react": "^3.1.0",
1515
"clsx": "^2.0.0",
16-
"prism-react-renderer": "^2.3.0",
17-
"react": "^18.0.0",
18-
"react-dom": "^18.0.0"
16+
"prism-react-renderer": "^2.4.1",
17+
"react": "^18.1.0",
18+
"react-dom": "^18.1.0"
1919
},
2020
"devDependencies": {
21-
"@docusaurus/module-type-aliases": "3.5.2",
22-
"@docusaurus/types": "3.5.2"
21+
"@docusaurus/module-type-aliases": "3.8.1",
22+
"@docusaurus/types": "3.8.1"
2323
},
2424
"browserslist": {
2525
"production": [

0 commit comments

Comments
 (0)