Skip to content

Commit f139022

Browse files
committed
Keep concrete syntax examples and simplify fork instructions
1 parent 4d6ab5e commit f139022

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

‎CONTRIBUTING.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,33 @@ In particular, you should prefer named `function` declarations over `const myFun
4646

4747
#### Don't use features that aren't standardized yet.
4848

49+
For example, **don't** write this:
50+
51+
```js
52+
function Greeting({isLoggedIn}) {
53+
return do {
54+
if (isLoggedIn) {
55+
<h1>Welcome back!</h1>;
56+
} else {
57+
<h1>Please sign in.</h1>;
58+
}
59+
};
60+
}
61+
```
62+
63+
The [`do` expression syntax](https://github.com/tc39/proposal-do-expressions) is still experimental.
64+
65+
Instead, **do** write this:
66+
67+
```js
68+
function Greeting({isLoggedIn}) {
69+
if (isLoggedIn) {
70+
return <h1>Welcome back!</h1>;
71+
}
72+
return <h1>Please sign in.</h1>;
73+
}
74+
```
75+
4976
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.
5077

5178
### Style

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This repo contains the source code and documentation powering [react.dev](https:
1515
### Installation
1616

1717
1. `cd react.dev` to go into the project root
18-
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; only needed once)
18+
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.
1919
3. `yarn` to install the website's npm dependencies
2020

2121
### Running locally

0 commit comments

Comments
 (0)