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
Copy file name to clipboardExpand all lines: README.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# [reactnative.dev](https://reactnative.dev/)·[](LICENSE-docs)[](CONTRIBUTING.md) <ahref="https://twitter.com/intent/follow?screen_name=reactnative"><imgsrc="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative"alt="Follow @reactnative" /></a>
1
+
# [reactnative.dev](https://reactnative.dev/)·[](LICENSE-docs)[](CONTRIBUTING.md) <ahref="https://twitter.com/intent/follow?screen_name=reactnative"><imgsrc="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative"alt="Follow @reactnative on X" /></a> <ahref="https://bsky.app/profile/reactnative.dev"><imgsrc="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff"alt="Follow @reactnative.dev on Bluesky" /></a>
2
2
3
3
This repo contains the website configuration and documentation powering the [React Native website](https://reactnative.dev/).
4
4
5
-
If you are looking for the source code of the [React Native Archive website](https://archive.reactnative.dev/) select the [`archive`](https://github.com/facebook/react-native-website/tree/archive) branch.
5
+
> If you are looking for the source code of the [React Native Archive website](https://archive.reactnative.dev/) select the [`archive`](https://github.com/facebook/react-native-website/tree/archive) branch.
6
6
7
7
## Contents
8
8
@@ -17,21 +17,19 @@ If you are looking for the source code of the [React Native Archive website](htt
17
17
### Prerequisites
18
18
19
19
1.[Git](https://git-scm.com/downloads).
20
-
1.[Node](https://nodejs.org/en/download/)_(version 20 or greater)_.
20
+
1.[Node](https://nodejs.org/en/download/)_(version 22 or greater)_.
1. A fork and clone of the `react-native-website` repo _(for any contributions)_.
24
23
25
24
### Installation
26
25
27
26
1.`cd react-native-website` to go into the project root.
28
27
1. Run `corepack enable` to enable Corepack.
29
28
30
-
> If the command above fails, run `npm install -g corepack@latest` to install the latest version of [Corepack](https://yarnpkg.com/corepack#installation).
29
+
> If the command above fails, run `npm install -g corepack@latest` to install the latest version of [Corepack](https://yarnpkg.com/corepack#installation).
31
30
32
31
1. Run `yarn` to install the website's workspace dependencies.
33
-
34
-
> If you want to retain the globally instaled `yarn` v1, you can use `corepack yarn` instead.
32
+
> If you want to retain the globally installed `yarn` classic, you can use `corepack yarn` instead.
35
33
36
34
### Running locally
37
35
@@ -112,7 +110,8 @@ If you're adding a new doc or you need to alter the order the docs appear in the
112
110
113
111
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`.
114
112
115
-
> **_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.
113
+
> [!NOTE]
114
+
> 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.
116
115
117
116
Docusaurus keeps track of the list of versions for the site in the `website/versions.json` file. The ordering of versions in this file should be in reverse chronological order.
118
117
@@ -150,7 +149,7 @@ The `showcase.json` file contains the list of users that are highlighted in the
150
149
1.`git checkout main` from any folder in your local `react-native-website` repository.
151
150
1.`git pull origin main` to ensure you have the latest main code.
152
151
1.`git checkout -b the-name-of-my-branch` to create a branch.
153
-
> replace `the-name-of-my-branch` with a suitable name, such as `update-animations-page`
152
+
> replace `the-name-of-my-branch` with a suitable name, such as `update-animations-page`
154
153
155
154
### Make the change
156
155
@@ -161,7 +160,11 @@ The `showcase.json` file contains the list of users that are highlighted in the
161
160
162
161
Visit **<http://localhost:3000/docs/next/YOUR-DOCS-PAGE>** to see your work.
163
162
164
-
> Visit <http://localhost:3000/versions> to see the list of all versions of the docs.
163
+
> [!NOTE]
164
+
> Visit <http://localhost:3000/versions> to see the list of all versions of the docs, if you have backported some of the changes.
165
+
166
+
> [!TIP]
167
+
> If you're adding assets, make sure they’re optimized for the web. You can use tools like [ImageOptim](https://imageoptim.com/mac) to automatically apply lossless compression to various file types.
165
168
166
169
### Test the change
167
170
@@ -175,7 +178,7 @@ If possible, test any visual changes in all latest versions of the following bro
175
178
1. Run `yarn prettier` and `yarn language:lint` in `./website` directory to ensure your changes are consistent with other files in the repo.
176
179
1. Run `yarn update-lock` to [deduplicate dependencies](https://yarnpkg.com/cli/dedupe).
177
180
1.`git add -A && git commit -m "My message"` to stage and commit your changes.
178
-
> replace `My message` with a commit message, such as `Fixed header logo on Android`
181
+
> replace `My message` with a commit message, such as `Fixed header logo on Android`
179
182
1.`git push my-fork-name the-name-of-my-branch`
180
183
1. Go to the [react-native-website repo](https://github.com/facebook/react-native-website) and you should see recently pushed branches.
This will copy the `package.json`[file from the Community template](https://github.com/react-native-community/template/blob/0.78-stable/template/package.json) to your project.
40
+
This will copy the `package.json`<RNTemplateRepoLinkhref="template/package.json">file from the Community template</RNTemplateRepoLink> to your project.
36
41
37
42
Next, install the NPM packages by running:
38
43
@@ -55,7 +60,7 @@ yarn install
55
60
56
61
Installation process has created a new `node_modules` folder. This folder stores all the JavaScript dependencies required to build your project.
57
62
58
-
Add `node_modules/` to your `.gitignore` file (here the [Community default one](https://github.com/react-native-community/template/blob/0.78-stable/template/_gitignore)).
63
+
Add `node_modules/` to your `.gitignore` file (here the <RNTemplateRepoLinkhref="template/_gitignore">Community default one</RNTemplateRepoLink>).
59
64
60
65
### 3. Install Development tools
61
66
@@ -86,9 +91,9 @@ To configure CocoaPods, we need two files:
86
91
87
92
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.78-stable/template/Gemfile) and for the [Podfile](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile).
120
+
Please use the Community Template as a reference point for the <RNTemplateRepoLinkhref="template/Gemfile">Gemfile</RNTemplateRepoLink> and for the <RNTemplateRepoLinkhref="template/ios/Podfile">Podfile</RNTemplateRepoLink>.
116
121
117
122
:::note
118
-
Remember to change [this line](https://github.com/react-native-community/template/blob/0.78-stable/template/ios/Podfile#L17).
123
+
Remember to change <RNTemplateRepoLinkhref="template/ios/Podfile#L17">this line</RNTemplateRepoLink>.
119
124
:::
120
125
121
126
Now, we need to run a couple of extra commands to install the Ruby gems and the Pods.
@@ -140,7 +145,7 @@ First, create an empty `index.js` file in the root of your React Native project.
140
145
141
146
`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.
142
147
143
-
Our `index.js` should look as follows (here the [Community template file as reference](https://github.com/react-native-community/template/blob/0.78-stable/template/index.js)):
148
+
Our `index.js` should look as follows (here the <RNTemplateRepoLinkhref="template/index.js">Community template file as reference</RNTemplateRepoLink>):
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.78-stable/template/App.tsx)):
159
+
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 (<RNTemplateRepoLinkhref="template/App.tsx">link</RNTemplateRepoLink>):
You can checkout the [metro.config.js file](https://github.com/react-native-community/template/blob/0.78-stable/template/metro.config.js) from the Community template file as reference.
468
+
You can checkout the <RNTemplateRepoLinkhref="template/metro.config.js">`metro.config.js` file</RNTemplateRepoLink> from the Community template file as reference.
464
469
465
470
Then, you need to create a `.watchmanconfig` file in the root of your project. The file must contain an empty json object:
466
471
467
472
```sh
468
473
echo {} > .watchmanconfig
469
474
```
470
475
471
-
Once you have the configurations file in place, you can run the bundler. Run the following command in the root directory of your project:
476
+
Once you have the configuration file in place, you can run the bundler. Run the following command in the root directory of your project:
0 commit comments