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
{{ message }}
Repository navigation
Commit db55709
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-37Lines changed: 3 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,7 @@ Thank you for your interest in contributing to the React Docs!
4
4
5
5
## Code of Conduct
6
6
7
-
Facebook has adopted a Code of Conduct that we expect project
8
-
participants to adhere to. Please [read the full text](https://code.facebook.com/codeofconduct)
9
-
so that you can understand what actions will and will not be tolerated.
7
+
We expect all project participants to follow our [Code of Conduct](./CODE_OF_CONDUCT.md).
10
8
11
9
## Technical Writing Tips
12
10
@@ -38,41 +36,9 @@ Ignore this if you're specifically describing `createElement`.
38
36
39
37
Ignore this if you're specifically writing about ES5.
40
38
41
-
#### Don't use ES6 features when equivalent ES5 features have no downsides.
39
+
#### Prefer readable syntax.
42
40
43
-
Remember that ES6 is still new to a lot of people. While we use it in many places (`const` / `let`, classes, arrow functions), if the equivalent ES5 code is just as straightforward and readable, consider using it.
44
-
45
-
In particular, you should prefer named `function` declarations over `const myFunction = () => ...` arrows for top-level functions. However, you *should* use arrow functions where they provide a tangible improvement (such as preserving `this` context inside a component). Consider both sides of the tradeoff when deciding whether to use a new feature.
46
-
47
-
#### Don't use features that aren't standardized yet.
48
-
49
-
For example, **don't** write this:
50
-
51
-
```js
52
-
classMyComponentextendsReact.Component {
53
-
state = {value:''};
54
-
handleChange= (e) => {
55
-
this.setState({value:e.target.value});
56
-
};
57
-
}
58
-
```
59
-
60
-
Instead, **do** write this:
61
-
62
-
```js
63
-
classMyComponentextendsReact.Component {
64
-
constructor(props) {
65
-
super(props);
66
-
this.handleChange=this.handleChange.bind(this);
67
-
this.state= {value:''};
68
-
}
69
-
handleChange(e) {
70
-
this.setState({value:e.target.value});
71
-
}
72
-
}
73
-
```
74
-
75
-
Ignore this rule if you're specifically describing an experimental proposal. Make sure to mention its experimental nature in the code and in the surrounding text.
41
+
Choose syntax that makes each example easier to follow. Prefer named `function` declarations over `const myFunction = () => ...` arrows for top-level functions. Use arrow functions when they make callbacks easier to read. In class components, arrow functions can also preserve the component's `this` value.
Copy file name to clipboardExpand all lines: README.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,26 @@
2
2
3
3
This repo contains the source code and documentation powering [react.dev](https://react.dev/).
4
4
5
+
<<<<<<< HEAD
5
6
> 以下はオリジナル(英語版)リポジトリの README です。日本語版 React ドキュメントへの貢献(翻訳・修正など)に興味がある方は[こちらの Wiki ページ](https://github.com/reactjs/ja.react.dev/wiki)を参照してください。
7
+
=======
8
+
React is a project of the [React Foundation](https://react.foundation/), hosted by the [Linux Foundation](https://www.linuxfoundation.org/).
9
+
>>>>>>> 15653c0f9b95d6c4845e614e5bcc94c7ee2128f6
6
10
7
11
## Getting started
8
12
9
13
### Prerequisites
10
14
11
15
1. Git
12
-
1. Node: any version starting with v16.8.0 or greater
13
-
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
16
+
1. Node: v24 or greater
17
+
1. Yarn Classic: See [Yarn website for installation instructions](https://classic.yarnpkg.com/en/docs/install/)
14
18
1. A fork of the repo (for any contributions)
15
19
1. A clone of the [react.dev repo](https://github.com/reactjs/react.dev) on your local machine
16
20
17
21
### Installation
18
22
19
23
1.`cd react.dev` to go into the project root
24
+
2.`git remote add my-fork-name https://github.com/YOUR_USERNAME/react.dev.git` to add your fork as a remote. Replace `YOUR_USERNAME` with your GitHub username. You only need to do this once.
20
25
3.`yarn` to install the website's npm dependencies
21
26
22
27
### Running locally
@@ -41,8 +46,8 @@ The documentation is divided into several sections with a different tone and pur
41
46
1. Follow the ["Running locally"](#running-locally) instructions
42
47
1. Save the files and check in the browser
43
48
1. Changes to React components in `src` will hot-reload
44
-
1. Changes to markdown files in `content` will hot-reload
45
-
1. If working with plugins, you may need to remove the `.cache` directory and restart the server
49
+
1. Changes to markdown files in `src/content` will hot-reload
50
+
1. If working with plugins, you may need to remove the `node_modules/.cache/react-docs-mdx` directory and restart the server
46
51
47
52
### Test the change
48
53
@@ -59,7 +64,7 @@ The documentation is divided into several sections with a different tone and pur
59
64
60
65
## Translation
61
66
62
-
If you are interested in translating `react.dev`, please see the current translation efforts [here](https://github.com/reactjs/react.dev/issues/4135).
67
+
If you are interested in translating `react.dev`, please see the current translation efforts [here](https://react.dev/community/translations).
63
68
64
69
## License
65
70
Content submitted to [react.dev](https://react.dev/) is CC-BY-4.0 licensed, as found in the [LICENSE-DOCS.md](https://github.com/reactjs/react.dev/blob/main/LICENSE-DOCS.md) file.
0 commit comments