Skip to content

Commit 1692cf6

Browse files
committed
Upgrade to React Native 0.81 & Expo 54
1 parent 8e6c2a7 commit 1692cf6

File tree

115 files changed

+22331
-16029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+22331
-16029
lines changed

app/examples.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import React from 'react';
33
import {
44
Linking,
5-
SafeAreaView,
65
ScrollView,
76
StatusBar,
87
StyleSheet,
98
Text,
109
TouchableOpacity,
1110
} from 'react-native';
1211
import {SheetManager} from 'react-native-actions-sheet';
12+
import {SafeAreaView} from 'react-native-safe-area-context';
1313

1414
const MainScreen = () => {
1515
const examples: {

app/sheets.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import {RouteDefinition, SheetDefinition, registerSheet} from 'react-native-actions-sheet';
1+
import {
2+
RouteDefinition,
3+
SheetDefinition,
4+
registerSheet,
5+
} from 'react-native-actions-sheet';
26
import Hello from './examples/hello';
37
import Gestures from './examples/gestures';
48
import SnapMe from './examples/snap-me';
@@ -15,7 +19,6 @@ import RouterSheet from './examples/router';
1519
import DrawUnderStatusBar from './examples/draw-under-statusbar';
1620
import ReturnData from './examples/return-data';
1721

18-
1922
// Register your Sheet component.
2023
/**
2124
* Registering the sheets here because otherwise sheet closes on
@@ -28,12 +31,12 @@ registerSheet('input', Input);
2831
registerSheet('payload', Payload);
2932
registerSheet('background-interaction', BackgroundInteraction);
3033
registerSheet('always-open', AlwaysOpen);
31-
registerSheet("scrollview", ScrollViewSheet);
32-
registerSheet('flatlist', FlatListSheet)
33-
registerSheet('flashlist', FlashListSheet)
34+
registerSheet('scrollview', ScrollViewSheet);
35+
registerSheet('flatlist', FlatListSheet);
36+
registerSheet('flashlist', FlashListSheet);
3437
registerSheet('scrollview-resize', ResizeSheet);
35-
registerSheet("nested-sheets", NestedSheet);
36-
registerSheet("sheet-router", RouterSheet);
38+
registerSheet('nested-sheets', NestedSheet);
39+
registerSheet('sheet-router', RouterSheet);
3740
registerSheet('draw-under-statusbar', DrawUnderStatusBar);
3841
registerSheet('return-data', ReturnData);
3942

@@ -56,25 +59,24 @@ declare module 'react-native-actions-sheet' {
5659
};
5760
}>;
5861
'background-interaction': SheetDefinition;
59-
'always-open': SheetDefinition,
60-
'scrollview': SheetDefinition,
61-
'flatlist': SheetDefinition,
62-
'flashlist': SheetDefinition,
63-
'scrollview-resize': SheetDefinition,
62+
'always-open': SheetDefinition;
63+
scrollview: SheetDefinition;
64+
flatlist: SheetDefinition;
65+
flashlist: SheetDefinition;
66+
'scrollview-resize': SheetDefinition;
6467
'sheet-router': SheetDefinition<{
6568
routes: {
6669
'route-a': RouteDefinition;
6770
'route-b': RouteDefinition<{
68-
value: string
71+
value: string;
6972
}>;
70-
}
73+
};
7174
}>;
7275
'nested-sheets': SheetDefinition;
7376
'draw-under-statusbar': SheetDefinition;
7477
'return-data': SheetDefinition<{
75-
returnValue: boolean
76-
}>,
77-
78+
returnValue: boolean;
79+
}>;
7880
}
7981
}
8082

example/.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
module.exports = {
22
root: true,
33
extends: '@react-native',
4-
r,
54
};

example/.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
ios/.xcode.env.local
23+
**/.xcode.env.local
2424

2525
# Android/IntelliJ
2626
#
@@ -33,6 +33,7 @@ local.properties
3333
.cxx/
3434
*.keystore
3535
!debug.keystore
36+
.kotlin/
3637

3738
# node.js
3839
#
@@ -56,11 +57,19 @@ yarn-error.log
5657
*.jsbundle
5758

5859
# Ruby / CocoaPods
59-
/ios/Pods/
60+
**/Pods/
6061
/vendor/bundle/
6162

6263
# Temporary files created by Metro to check the health of the file watcher
6364
.metro-health-check*
6465

6566
# testing
6667
/coverage
68+
69+
# Yarn
70+
.yarn/*
71+
!.yarn/patches
72+
!.yarn/plugins
73+
!.yarn/releases
74+
!.yarn/sdks
75+
!.yarn/versions

example/.prettierrc.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module.exports = {
22
arrowParens: 'avoid',
3-
bracketSameLine: true,
4-
bracketSpacing: false,
53
singleQuote: true,
64
trailingComma: 'all',
75
};

example/App.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
2-
import {SheetProvider} from 'react-native-actions-sheet';
3-
import {GestureHandlerRootView} from 'react-native-gesture-handler';
2+
import { SheetProvider } from 'react-native-actions-sheet';
3+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
44
import changeNavigationBarColor from 'react-native-navigation-bar-color';
55
import MainScreen from '../app/examples';
66
import '../app/sheets';
7-
import {SafeAreaProvider} from 'react-native-safe-area-context';
7+
import { SafeAreaProvider } from 'react-native-safe-area-context';
88

99
const App = () => {
1010
// To match the style of action sheet navigation bar, we use react-native-navigation-bar-color on android and the app.
@@ -18,7 +18,8 @@ const App = () => {
1818
<GestureHandlerRootView
1919
style={{
2020
flex: 1,
21-
}}>
21+
}}
22+
>
2223
<SheetProvider context="global">
2324
<MainScreen />
2425
</SheetProvider>

example/Gemfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.13'
7-
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'
10+
gem 'concurrent-ruby', '< 1.3.4'
11+
12+
# Ruby 3.4.0 has removed some libraries from the standard library.
13+
gem 'bigdecimal'
14+
gem 'logger'
15+
gem 'benchmark'
16+
gem 'mutex_m'

example/README.md

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,76 @@ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped
22

33
# Getting Started
44

5-
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
5+
> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.
66
7-
## Step 1: Start the Metro Server
7+
## Step 1: Start Metro
88

9-
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
9+
First, you will need to run **Metro**, the JavaScript build tool for React Native.
1010

11-
To start Metro, run the following command from the _root_ of your React Native project:
11+
To start the Metro dev server, run the following command from the root of your React Native project:
1212

13-
```bash
14-
# using npm
13+
```sh
14+
# Using npm
1515
npm start
1616

1717
# OR using Yarn
1818
yarn start
1919
```
2020

21-
## Step 2: Start your Application
21+
## Step 2: Build and run your app
2222

23-
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
23+
With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
2424

25-
### For Android
25+
### Android
2626

27-
```bash
28-
# using npm
27+
```sh
28+
# Using npm
2929
npm run android
3030

3131
# OR using Yarn
3232
yarn android
3333
```
3434

35-
### For iOS
35+
### iOS
3636

37-
```bash
38-
# using npm
37+
For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
38+
39+
The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
40+
41+
```sh
42+
bundle install
43+
```
44+
45+
Then, and every time you update your native dependencies, run:
46+
47+
```sh
48+
bundle exec pod install
49+
```
50+
51+
For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
52+
53+
```sh
54+
# Using npm
3955
npm run ios
4056

4157
# OR using Yarn
4258
yarn ios
4359
```
4460

45-
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
61+
If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
62+
63+
This is one way to run your app — you can also build it directly from Android Studio or Xcode.
4664

47-
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
65+
## Step 3: Modify your app
4866

49-
## Step 3: Modifying your App
67+
Now that you have successfully run the app, let's make changes!
5068

51-
Now that you have successfully run the app, let's modify it.
69+
Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh).
5270

53-
1. Open `App.tsx` in your text editor of choice and edit some lines.
54-
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
71+
When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
5572

56-
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
73+
- **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Dev Menu**, accessed via <kbd>Ctrl</kbd> + <kbd>M</kbd> (Windows/Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (macOS).
74+
- **iOS**: Press <kbd>R</kbd> in iOS Simulator.
5775

5876
## Congratulations! :tada:
5977

@@ -62,11 +80,11 @@ You've successfully run and modified your React Native App. :partying_face:
6280
### Now what?
6381

6482
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
65-
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
83+
- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
6684

6785
# Troubleshooting
6886

69-
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
87+
If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
7088

7189
# Learn More
7290

example/__tests__/App.test.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
* @format
33
*/
44

5-
import 'react-native';
65
import React from 'react';
6+
import ReactTestRenderer from 'react-test-renderer';
77
import App from '../App';
88

9-
// Note: import explicitly to use the types shipped with jest.
10-
import {it} from '@jest/globals';
11-
12-
// Note: test renderer must be required after react-native.
13-
import renderer from 'react-test-renderer';
14-
15-
it('renders correctly', () => {
16-
renderer.create(<App />);
9+
test('renders correctly', async () => {
10+
await ReactTestRenderer.act(() => {
11+
ReactTestRenderer.create(<App />);
12+
});
1713
});

example/android/app/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ apply plugin: "com.facebook.react"
88
*/
99
react {
1010
/* Folders */
11-
// The root of your project, i.e. where "package.json" lives. Default is '..'
12-
// root = file("../")
13-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
14-
// reactNativeDir = file("../node_modules/react-native")
15-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
16-
// codegenDir = file("../node_modules/@react-native/codegen")
17-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
18-
// cliFile = file("../node_modules/react-native/cli.js")
11+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
12+
// root = file("../../")
13+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14+
// reactNativeDir = file("../../node_modules/react-native")
15+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16+
// codegenDir = file("../../node_modules/@react-native/codegen")
17+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18+
// cliFile = file("../../node_modules/react-native/cli.js")
1919

2020
/* Variants */
2121
// The list of variants to that are debuggable. For those we're going to
@@ -49,6 +49,9 @@ react {
4949
//
5050
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5151
// hermesFlags = ["-O", "-output-source-map"]
52+
53+
/* Autolinking */
54+
autolinkLibrariesWithApp()
5255
}
5356

5457
/**
@@ -60,14 +63,14 @@ def enableProguardInReleaseBuilds = false
6063
* The preferred build flavor of JavaScriptCore (JSC)
6164
*
6265
* For example, to use the international variant, you can use:
63-
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
66+
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
6467
*
6568
* The international variant includes ICU i18n library and necessary data
6669
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
6770
* give correct results when using with locales other than en-US. Note that
6871
* this variant is about 6MiB larger per architecture than default.
6972
*/
70-
def jscFlavor = 'org.webkit:android-jsc:+'
73+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
7174

7275
android {
7376
ndkVersion rootProject.ext.ndkVersion
@@ -107,13 +110,10 @@ android {
107110
dependencies {
108111
// The version of react-native is set by the React Native Gradle Plugin
109112
implementation("com.facebook.react:react-android")
110-
implementation("com.facebook.react:flipper-integration")
111113

112114
if (hermesEnabled.toBoolean()) {
113115
implementation("com.facebook.react:hermes-android")
114116
} else {
115117
implementation jscFlavor
116118
}
117119
}
118-
119-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

0 commit comments

Comments
 (0)