You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a reminder, all contributors are expected to adhere to the [Code of Conduct](https://github.com/facebook/react-native-website/blob/main/CODE_OF_CONDUCT.md).
Copy file name to clipboardExpand all lines: README.md
+35-34Lines changed: 35 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,21 +25,21 @@ If you are looking for the source code of the [React Native Archive website](htt
25
25
26
26
### Prerequisites
27
27
28
-
1.[Git](https://git-scm.com/downloads).
29
-
1.[Node](https://nodejs.org/en/download/)_(version 12 or greater)_.
30
-
1.[Yarn](https://yarnpkg.com/lang/en/docs/install/)_(version 1.5 or greater)_.
31
-
1.A fork of the repo _(for any contributions)_.
32
-
1.A clone of the `react-native-website` repo.
28
+
1.[Git](https://git-scm.com/downloads).
29
+
1.[Node](https://nodejs.org/en/download/)_(version 12 or greater)_.
30
+
1.[Yarn](https://yarnpkg.com/lang/en/docs/install/)_(version 1.5 or greater)_.
31
+
1. A fork of the repo _(for any contributions)_.
32
+
1. A clone of the `react-native-website` repo.
33
33
34
34
### Installation
35
35
36
-
1.`cd react-native-website` to go into the project root.
37
-
1.Run `yarn` to install the website's workspace dependencies.
36
+
1.`cd react-native-website` to go into the project root.
37
+
1. Run `yarn` to install the website's workspace dependencies.
38
38
39
39
### Running locally
40
40
41
-
1.Run `yarn start` to start the development server _(powered by [Docusaurus](https://v2.docusaurus.io))_.
42
-
1.Open http://localhost:3000/ site in your favorite browser.
41
+
1. Run `yarn start` to start the development server _(powered by [Docusaurus](https://docusaurus.io))_.
42
+
1. Open <http://localhost:3000/> site in your favorite browser.
43
43
44
44
## 📖 Overview
45
45
@@ -93,12 +93,13 @@ react-native-website/
93
93
├── versioned_sidebars/
94
94
│ ├── [GENERATED VERSIONED SIDEBARS]
95
95
│ └── ...
96
-
├── docusaurus.config.js
96
+
├── docusaurus.config.ts
97
97
├── package.json
98
98
├── showcase.json
99
-
├── sidebars.json
100
-
├── sidebarsArchitecture.json
101
-
├── sidebarsContributing.json
99
+
├── sidebars.ts
100
+
├── sidebarsArchitecture.ts
101
+
├── sidebarsCommunity.ts
102
+
├── sidebarsContributing.ts
102
103
└── versions.json
103
104
```
104
105
@@ -108,11 +109,11 @@ As mentioned above, the `docs` folder contains the source files for docs from "G
108
109
The doc files for the "Architecture" and "Contribution" tabs are located inside `website` in the respective directories (unversioned/static docs).
109
110
In most cases, you will only want to edit the files within those directories.
110
111
111
-
If you're adding a new doc or you need to alter the order the docs appear in the sidebar, take a look at the `sidebars.json`, `sidebarsArchitecture.json` and `sidebarsContributing.json` files in the `website` directory. The sidebar files contain a list of document ids that should match those defined in the header metadata (aka frontmatter) of the docs markdown files.
112
+
If you're adding a new doc or you need to alter the order the docs appear in the sidebar, take a look at the `sidebars.ts`, `sidebarsArchitecture.ts` and `sidebarsContributing.ts` files in the `website` directory. The sidebar files contain a list of document ids that should match those defined in the header metadata (aka frontmatter) of the docs markdown files.
112
113
113
114
### Versioned docs
114
115
115
-
Part of the React Native website is versioned to allow users to go back and see the Guides or API reference documentation for any given release. A new version of the website is generally generated whenever there is a new React Native release. When this happens, any changes made to the `docs` and `website/sidebars.json` files will be copied over to the corresponding location within `website/versioned_docs` and `website/versioned_sidebars`.
116
+
Part of the React Native website is versioned to allow users to go back and see the Guides or API reference documentation for any given release. A new version of the website is generally generated whenever there is a new React Native release. When this happens, any changes made to the `docs` and `website/sidebars.ts` files will be copied over to the corresponding location within `website/versioned_docs` and `website/versioned_sidebars`.
116
117
117
118
> **_Note:_** Do not edit the auto-generated files within `versioned_docs` or `versioned_sidebars` unless you are sure it is necessary. Edits made to older versions will not be propagated to newer versions of the versioned docs.
118
119
@@ -128,13 +129,13 @@ This can be done by updating the `package.json` and configuration files in `scri
128
129
129
130
##### After Release
130
131
131
-
1.`cd react-native-website` to go into the project root.
132
-
1.`cd website` to go into the website portion of the project.
133
-
1.Run `yarn version:cut <newVersion>` where `<newVersion>` is the new version being released.
132
+
1.`cd react-native-website` to go into the project root.
133
+
1.`cd website` to go into the website portion of the project.
134
+
1. Run `yarn version:cut <newVersion>` where `<newVersion>` is the new version being released.
134
135
135
136
## 🔧 Website configuration
136
137
137
-
The main config file for the website can be found at `website/docusaurus.config.js`. This file tells [Docusaurus how to build the website](https://v2.docusaurus.io/docs/configuration). Edits to this file are rarely necessary.
138
+
The main config file for the website can be found at `website/docusaurus.config.ts`. This file tells [Docusaurus how to build the website](https://docusaurus.io/docs/configuration). Edits to this file are rarely necessary.
138
139
139
140
The `core` subdirectory contains JavaScript and React components that are the core part of the website.
140
141
@@ -148,21 +149,21 @@ The `showcase.json` file contains the list of users that are highlighted in the
148
149
149
150
### Create a branch
150
151
151
-
1.`git checkout main` from any folder in your local `react-native-website` repository.
152
-
1.`git pull origin main` to ensure you have the latest main code.
153
-
1.`git checkout -b the-name-of-my-branch` to create a branch.
152
+
1.`git checkout main` from any folder in your local `react-native-website` repository.
153
+
1.`git pull origin main` to ensure you have the latest main code.
154
+
1.`git checkout -b the-name-of-my-branch` to create a branch.
154
155
> replace `the-name-of-my-branch` with a suitable name, such as `update-animations-page`
155
156
156
157
### Make the change
157
158
158
-
1.Follow the "[Running locally](#running-locally)" instructions.
159
-
1.Save the files and check in the browser.
160
-
1.Some changes may require a server restart to generate new files. (Pages in `docs` always do!)
161
-
1.Edits to pages in `docs` will only be visible in the latest version of the documentation, called "Next", located under the `docs/next` path.
159
+
1. Follow the "[Running locally](#running-locally)" instructions.
160
+
1. Save the files and check in the browser.
161
+
1. Some changes may require a server restart to generate new files. (Pages in `docs` always do!)
162
+
1. Edits to pages in `docs` will only be visible in the latest version of the documentation, called "Next", located under the `docs/next` path.
162
163
163
-
Visit **http://localhost:3000/docs/next/YOUR-DOCS-PAGE** to see your work.
164
+
Visit **<http://localhost:3000/docs/next/YOUR-DOCS-PAGE>** to see your work.
164
165
165
-
> Visit http://localhost:3000/versions to see the list of all versions of the docs.
166
+
> Visit <http://localhost:3000/versions> to see the list of all versions of the docs.
166
167
167
168
### Test the change
168
169
@@ -173,13 +174,13 @@ If possible, test any visual changes in all latest versions of the following bro
173
174
174
175
### Push it
175
176
176
-
1.Run `yarn prettier` and `yarn language:lint` in `./website` directory to ensure your changes are consistent with other files in the repo.
177
-
1.`git add -A && git commit -m "My message"` to stage and commit your changes.
177
+
1. Run `yarn prettier` and `yarn language:lint` in `./website` directory to ensure your changes are consistent with other files in the repo.
178
+
1.`git add -A && git commit -m "My message"` to stage and commit your changes.
178
179
> replace `My message` with a commit message, such as `Fixed header logo on Android`
179
-
1.`git push my-fork-name the-name-of-my-branch`
180
-
1.Go to the [react-native-website repo](https://github.com/facebook/react-native-website) and you should see recently pushed branches.
181
-
1.Follow GitHub's instructions.
182
-
1.Describe briefly your changes (in case of visual changes, please include screenshots).
180
+
1.`git push my-fork-name the-name-of-my-branch`
181
+
1. Go to the [react-native-website repo](https://github.com/facebook/react-native-website) and you should see recently pushed branches.
182
+
1. Follow GitHub's instructions.
183
+
1. Describe briefly your changes (in case of visual changes, please include screenshots).
This will copy the `package.json`[file from the Community template](https://github.com/react-native-community/template/blob/0.76-stable/template/package.json) to your project.
35
+
This will copy the `package.json`[file from the Community template](https://github.com/react-native-community/template/blob/0.77-stable/template/package.json) to your project.
36
36
37
37
Next, install the NPM packages by running:
38
38
@@ -55,7 +55,7 @@ yarn install
55
55
56
56
Installation process has created a new `node_modules` folder. This folder stores all the JavaScript dependencies required to build your project.
57
57
58
-
Add `node_modules/` to your `.gitignore` file (here the [Community default one](https://github.com/react-native-community/template/blob/0.76-stable/template/_gitignore)).
58
+
Add `node_modules/` to your `.gitignore` file (here the [Community default one](https://github.com/react-native-community/template/blob/0.77-stable/template/_gitignore)).
59
59
60
60
### 3. Install Development tools
61
61
@@ -87,22 +87,22 @@ To configure CocoaPods, we need two files:
87
87
For the **Gemfile**, go to the root directory of your project and run this command
Please use the Community Template as a reference point for the [Gemfile](https://github.com/react-native-community/template/blob/0.76-stable/template/Gemfile) and for the [Podfile](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile).
100
+
Please use the Community Template as a reference point for the [Gemfile](https://github.com/react-native-community/template/blob/0.77-stable/template/Gemfile) and for the [Podfile](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile).
101
101
102
102
:::note
103
-
Remember to change [this line](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile#L17) and [this line](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile#L26) of the Podfile to match the name of your app.
103
+
Remember to change [this line](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile#L17) and [this line](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile#L26) of the Podfile to match the name of your app.
104
104
105
-
If your app don't have tests, remember to remove [this block](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile#L26-L29).
105
+
If your app don't have tests, remember to remove [this block](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile#L26-L29).
106
106
:::
107
107
108
108
Now, we need to run a couple of extra commands to install the Ruby gems and the Pods.
@@ -127,7 +127,7 @@ First, create an empty `index.js` file in the root of your React Native project.
127
127
128
128
`index.js` is the starting point for React Native applications, and it is always required. It can be a small file that `import`s other file that are part of your React Native component or application, or it can contain all the code that is needed for it.
129
129
130
-
Our `index.js` should look as follows (here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.76-stable/template/index.js)):
130
+
Our `index.js` should look as follows (here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.77-stable/template/index.js)):
Let's create an `App.tsx` file. This is a [TypeScript](https://www.typescriptlang.org/) file that can have [JSX](<https://en.wikipedia.org/wiki/JSX_(JavaScript)>) expressions. It contains the root React Native component that we will integrate into our iOS application ([link](https://github.com/react-native-community/template/blob/0.76-stable/template/App.tsx)):
141
+
Let's create an `App.tsx` file. This is a [TypeScript](https://www.typescriptlang.org/) file that can have [JSX](<https://en.wikipedia.org/wiki/JSX_(JavaScript)>) expressions. It contains the root React Native component that we will integrate into our iOS application ([link](https://github.com/react-native-community/template/blob/0.77-stable/template/App.tsx)):
Here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.76-stable/template/App.tsx)
214
+
Here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.77-stable/template/App.tsx)
215
215
216
216
## 5. Integrating with your iOS code
217
217
@@ -279,7 +279,7 @@ First, we need to extends the `AppDelegate` to inherit from one of the classes p
279
279
280
280
To achieve this, we have to modify the `AppDelegate.h` file and the `AppDelegate.m` files:
281
281
282
-
1. Open the `AppDelegate.h` files and modify it as it follows (See the official template's [AppDelegate.h](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/HelloWorld/AppDelegate.h) as reference):
282
+
1. Open the `AppDelegate.h` files and modify it as it follows (See the official template's [AppDelegate.h](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/HelloWorld/AppDelegate.h) as reference):
283
283
284
284
```diff title="AppDelegate.h changes"
285
285
#import<UIKit/UIKit.h>
@@ -292,7 +292,7 @@ To achieve this, we have to modify the `AppDelegate.h` file and the `AppDelegate
292
292
@end
293
293
```
294
294
295
-
2. Open the `AppDelegate.mm` file and modify it as it follows (See the official template's [AppDelegate.mm](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/HelloWorld/AppDelegate.mm) as reference
295
+
2. Open the `AppDelegate.mm` file and modify it as it follows (See the official template's [AppDelegate.mm](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/HelloWorld/AppDelegate.mm) as reference
296
296
297
297
```diff title="AppDelegate.mm"
298
298
#import "AppDelegate.h"
@@ -349,7 +349,6 @@ To achieve this, we have to modify the `AppDelegate.swift`
You can checkout the [metro.config.js file](https://github.com/react-native-community/template/blob/0.76-stable/template/metro.config.js) from the Community template file as reference.
553
+
You can checkout the [metro.config.js file](https://github.com/react-native-community/template/blob/0.77-stable/template/metro.config.js) from the Community template file as reference.
555
554
556
555
Once you have the config file in place, you can run the bundler. Run the following command in the root directory of your project:
0 commit comments