@react-native-community/template 0.76.0-rc.2-3b1a411 → 0.77.0-nightly-2024924-b3ed5a7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/package.json +2 -2
- package/template/README.md +41 -23
- package/template/__tests__/App.test.tsx +5 -3
- package/template/package.json +7 -8
package/README.md
CHANGED
|
@@ -5,6 +5,21 @@ The template used by `npx @react-native-community/cli init` to bootstrap a React
|
|
|
5
5
|
[![Build Status][build-badge]][build] [![Version][version-badge]][package] [![MIT License][license-badge]][license] [![PRs Welcome][prs-welcome-badge]][prs-welcome]
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
# Create Latest CLI Project
|
|
9
|
+
Using this command create latest react-native project with this template
|
|
10
|
+
```
|
|
11
|
+
npx @react-native-community/cli@latest init TestApp
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
# Create Specific Version React-Native CLI Project
|
|
15
|
+
Add version flag and specify that existing version of react-native to create project.
|
|
16
|
+
Note that this command will create a new project from the template using the specific version passed to the flag
|
|
17
|
+
|
|
18
|
+
npx @react-native-community/cli init TestApp --version <VERSION>
|
|
19
|
+
|
|
20
|
+
Replace `<VERSION>` with the version number you need. For example: 0.75.2.
|
|
21
|
+
|
|
22
|
+
|
|
8
23
|
## Contents
|
|
9
24
|
|
|
10
25
|
- [About](#about)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-community/template",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.0-nightly-2024924-b3ed5a7",
|
|
4
4
|
"description": "The template used by `npx @react-native-community/cli init` to bootstrap a React Native application.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "jest",
|
|
11
|
-
"version": "
|
|
11
|
+
"version": "nightly"
|
|
12
12
|
},
|
|
13
13
|
"type": "commonjs",
|
|
14
14
|
"files": [
|
package/template/README.md
CHANGED
|
@@ -2,58 +2,76 @@ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped
|
|
|
2
2
|
|
|
3
3
|
# Getting Started
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.
|
|
6
6
|
|
|
7
|
-
## Step 1: Start
|
|
7
|
+
## Step 1: Start Metro
|
|
8
8
|
|
|
9
|
-
First, you will need to
|
|
9
|
+
First, you will need to run **Metro**, the JavaScript build tool for React Native.
|
|
10
10
|
|
|
11
|
-
To start Metro, run the following command from the
|
|
11
|
+
To start the Metro dev server, run the following command from the root of your React Native project:
|
|
12
12
|
|
|
13
|
-
```
|
|
14
|
-
#
|
|
13
|
+
```sh
|
|
14
|
+
# Using npm
|
|
15
15
|
npm start
|
|
16
16
|
|
|
17
17
|
# OR using Yarn
|
|
18
18
|
yarn start
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
## Step 2:
|
|
21
|
+
## Step 2: Build and run your app
|
|
22
22
|
|
|
23
|
-
|
|
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:
|
|
24
24
|
|
|
25
|
-
###
|
|
25
|
+
### Android
|
|
26
26
|
|
|
27
|
-
```
|
|
28
|
-
#
|
|
27
|
+
```sh
|
|
28
|
+
# Using npm
|
|
29
29
|
npm run android
|
|
30
30
|
|
|
31
31
|
# OR using Yarn
|
|
32
32
|
yarn android
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### iOS
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
39
55
|
npm run ios
|
|
40
56
|
|
|
41
57
|
# OR using Yarn
|
|
42
58
|
yarn ios
|
|
43
59
|
```
|
|
44
60
|
|
|
45
|
-
If everything is set up
|
|
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.
|
|
46
64
|
|
|
47
|
-
|
|
65
|
+
## Step 3: Modify your app
|
|
48
66
|
|
|
49
|
-
|
|
67
|
+
Now that you have successfully run the app, let's make changes!
|
|
50
68
|
|
|
51
|
-
|
|
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).
|
|
52
70
|
|
|
53
|
-
|
|
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:
|
|
55
72
|
|
|
56
|
-
|
|
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.
|
|
57
75
|
|
|
58
76
|
## Congratulations! :tada:
|
|
59
77
|
|
|
@@ -62,11 +80,11 @@ You've successfully run and modified your React Native App. :partying_face:
|
|
|
62
80
|
### Now what?
|
|
63
81
|
|
|
64
82
|
- 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 [
|
|
83
|
+
- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
|
|
66
84
|
|
|
67
85
|
# Troubleshooting
|
|
68
86
|
|
|
69
|
-
If you
|
|
87
|
+
If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
|
|
70
88
|
|
|
71
89
|
# Learn More
|
|
72
90
|
|
|
@@ -10,8 +10,10 @@ import App from '../App';
|
|
|
10
10
|
import {it} from '@jest/globals';
|
|
11
11
|
|
|
12
12
|
// Note: test renderer must be required after react-native.
|
|
13
|
-
import
|
|
13
|
+
import ReactTestRenderer from 'react-test-renderer';
|
|
14
14
|
|
|
15
|
-
it('renders correctly', () => {
|
|
16
|
-
|
|
15
|
+
it('renders correctly', async () => {
|
|
16
|
+
await ReactTestRenderer.act(() => {
|
|
17
|
+
ReactTestRenderer.create(<App />);
|
|
18
|
+
});
|
|
17
19
|
});
|
package/template/package.json
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"test": "jest"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"react": "
|
|
14
|
-
"react-native": "
|
|
13
|
+
"react": "19.0.0-rc-fb9a90fa48-20240614",
|
|
14
|
+
"react-native": "nightly"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@babel/core": "^7.25.2",
|
|
@@ -20,17 +20,16 @@
|
|
|
20
20
|
"@react-native-community/cli": "15.0.0-alpha.2",
|
|
21
21
|
"@react-native-community/cli-platform-android": "15.0.0-alpha.2",
|
|
22
22
|
"@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
|
|
23
|
-
"@react-native/babel-preset": "
|
|
24
|
-
"@react-native/eslint-config": "
|
|
25
|
-
"@react-native/metro-config": "
|
|
26
|
-
"@react-native/typescript-config": "
|
|
23
|
+
"@react-native/babel-preset": "nightly",
|
|
24
|
+
"@react-native/eslint-config": "nightly",
|
|
25
|
+
"@react-native/metro-config": "nightly",
|
|
26
|
+
"@react-native/typescript-config": "nightly",
|
|
27
27
|
"@types/react": "^18.2.6",
|
|
28
28
|
"@types/react-test-renderer": "^18.0.0",
|
|
29
|
-
"babel-jest": "^29.6.3",
|
|
30
29
|
"eslint": "^8.19.0",
|
|
31
30
|
"jest": "^29.6.3",
|
|
32
31
|
"prettier": "2.8.8",
|
|
33
|
-
"react-test-renderer": "
|
|
32
|
+
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
|
|
34
33
|
"typescript": "5.0.4"
|
|
35
34
|
},
|
|
36
35
|
"engines": {
|