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 4e3447b
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-34Lines changed: 2 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,41 +38,9 @@ Ignore this if you're specifically describing `createElement`.
38
38
39
39
Ignore this if you're specifically writing about ES5.
40
40
41
-
#### Don't use ES6 features when equivalent ES5 features have no downsides.
41
+
#### Prefer readable syntax.
42
42
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.
43
+
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
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,19 @@ Hi dev, We are Bengali React doc translation community welcome you to join the d
10
10
### Prerequisites
11
11
12
12
1. Git
13
-
1. Node: any version starting with v16.8.0 or greater
14
-
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
13
+
1. Node: v24 or greater
14
+
1. Yarn Classic: See [Yarn website for installation instructions](https://classic.yarnpkg.com/en/docs/install/)
15
15
1. A fork of the repo (for any contributions)
16
16
1. A clone of the [bn.react.dev repo](https://github.com/reactjs/bn.react.dev) on your local machine
17
17
18
18
### Installation
19
19
20
+
<<<<<<< HEAD
20
21
1.`cd bn.react.dev` to go into the project root
22
+
=======
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.
25
+
>>>>>>> 46a54e0592729712b7640308b53268e84fdc7c9f
21
26
3.`yarn` to install the website's npm dependencies
22
27
23
28
### Running locally
@@ -42,8 +47,8 @@ The documentation is divided into several sections with a different tone and pur
42
47
1. Follow the ["Running locally"](#running-locally) instructions
43
48
1. Save the files and check in the browser
44
49
1. Changes to React components in `src` will hot-reload
45
-
1. Changes to markdown files in `content` will hot-reload
46
-
1. If working with plugins, you may need to remove the `.cache` directory and restart the server
50
+
1. Changes to markdown files in `src/content` will hot-reload
51
+
1. If working with plugins, you may need to remove the `node_modules/.cache/react-docs-mdx` directory and restart the server
47
52
48
53
### Test the change
49
54
@@ -60,7 +65,11 @@ The documentation is divided into several sections with a different tone and pur
60
65
61
66
## Translation
62
67
68
+
<<<<<<< HEAD
63
69
If you are interested in translating `bn.react.dev`, please see the current translation efforts [here](https://github.com/reactjs/bn.react.dev/issues/1).
70
+
=======
71
+
If you are interested in translating `react.dev`, please see the current translation efforts [here](https://react.dev/community/translations).
72
+
>>>>>>> 46a54e0592729712b7640308b53268e84fdc7c9f
64
73
65
74
## License
66
75
Content submitted to [bn.react.dev](https://bn.react.dev/) is CC-BY-4.0 licensed, as found in the [LICENSE-DOCS.md](https://github.com/reactjs/bn.react.dev/blob/main/LICENSE-DOCS.md) file.
Some API pages also include [Troubleshooting](/reference/react/useEffect#troubleshooting) (for common problems) and [Alternatives](/reference/react-dom/findDOMNode#alternatives) (for deprecated APIs).
610
+
Some API pages also include [Troubleshooting](/reference/react/useEffect#troubleshooting) (for common problems) and [Alternatives](https://18.react.dev/reference/react-dom/findDOMNode#alternatives) (for deprecated APIs).
611
611
612
612
We hope that this approach will make the API reference useful not only as a way to look up an argument, but as a way to see all the different things you can do with any given API—and how it connects to the other ones.
0 commit comments