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 705a2d0
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CLAUDE.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code when working with this repository.
4
4
5
5
## Project Overview
6
6
7
-
This is the React documentation website (react.dev), built with Next.js and React. See `package.json` for dependency versions and `.nvmrc` for the Node.js version used in development and CI. Documentation is written in MDX format.
7
+
This is the React documentation website (react.dev), built with Next.js 15.1.12 and React 19. Documentation is written in MDX format.
8
8
9
9
## Development Commands
10
10
@@ -13,7 +13,6 @@ yarn build # Production build
13
13
yarn lint # Run ESLint
14
14
yarn lint:fix # Auto-fix lint issues
15
15
yarn tsc # TypeScript type checking
16
-
yarn ci-check # Run the same validation checks as CI
17
16
yarn check-all # Run prettier, lint:fix, tsc, and rss together
18
17
```
19
18
@@ -48,6 +47,6 @@ When editing files in `src/content/`, the appropriate skill will be auto-suggest
48
47
For MDX components (DeepDive, Pitfall, Note, etc.), invoke `/docs-components`.
49
48
For Sandpack code examples, invoke `/docs-sandpack`.
50
49
51
-
See `.claude/skills/docs-voice/SKILL.md` for shared writing conventions, and the `docs-writer-learn`, `docs-writer-reference`, and `docs-writer-blog` skills for page-specific guidance.
50
+
See `.claude/skills/` for comprehensive style guidelines.
52
51
53
52
Prettier is used for formatting (config in `.prettierrc`).
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,15 +38,15 @@ Ignore this if you're specifically describing `createElement`.
38
38
39
39
Ignore this if you're specifically writing about ES5.
40
40
41
-
#### Prefer readable JavaScript.
41
+
#### Don't use ES6 features when equivalent ES5 features have no downsides.
42
42
43
-
Use modern JavaScript when it makes an example clearer. Prefer named `function` declarations for components and top-level functions. Use arrow functions for inline callbacks where they improve readability.
43
+
While we use ES6 in many places (`const` / `let`, classes, arrow functions), if the equivalent ES5 code is just as straightforward and readable, consider using it.
44
44
45
-
#### Don't use features that aren't standardized yet.
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
46
47
-
Use standardized JavaScript features in examples. Class fields are standardized and may be used when documenting class components. Prefer function components and Hooks for new examples, unless the page documents a class-specific API.
47
+
#### Don't use features that aren't standardized yet.
48
48
49
-
If you're specifically describing an experimental proposal, mention its experimental nature in the code and surrounding text.
49
+
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.
1.`yarn install --frozen-lockfile` to install the website's dependencies
17
+
1.`cd react.dev` to go into the project root
18
+
3.`yarn` to install the website's npm dependencies
24
19
25
20
### Running locally
26
21
27
22
1.`yarn dev` to start the development server (powered by [Next.js](https://nextjs.org/))
28
-
1.Open [http://localhost:3000](http://localhost:3000)in your browser
23
+
1.`open http://localhost:3000` to open the site in your favorite browser
29
24
30
25
## Contributing
31
26
@@ -35,36 +30,36 @@ The documentation is divided into several sections with a different tone and pur
35
30
36
31
### Create a branch
37
32
33
+
1.`git remote add upstream https://github.com/reactjs/react.dev.git` to add the source repo as a remote (only needed once)
38
34
1.`git checkout main` from any folder in your local `react.dev` repository
39
-
1.`git fetch upstream` to get the latest changes from the source repo
40
-
1.`git merge --ff-only upstream/main` to update your local `main`
35
+
1.`git pull --ff-only upstream main` to ensure you have the latest main code
41
36
1.`git checkout -b the-name-of-my-branch` (replacing `the-name-of-my-branch` with a suitable name) to create a branch
42
37
43
38
### Make the change
44
39
45
40
1. Follow the ["Running locally"](#running-locally) instructions
46
41
1. Save the files and check in the browser
47
-
1. Changes to React components in `src` will hot-reload
48
-
1. Changes to Markdown files in `src/content` will hot-reload
49
-
1. If changes to MDX plugins aren't reflected, stop the server, remove `node_modules/.cache/react-docs-mdx`, and restart it
42
+
1. Changes to React components in `src` will hot-reload
43
+
1. Changes to markdown files in `src/content` will hot-reload
44
+
1. If working with plugins, you may need to remove the `node_modules/.cache/react-docs-mdx` directory and restart the server
50
45
51
46
### Test the change
52
47
53
48
1. If possible, test any visual changes in all latest versions of common browsers, on both desktop and mobile.
54
-
1. Run `yarn ci-check` to run the same checks as CI: formatting, ESLint, local ESLint rule tests, TypeScript, heading IDs, RSS generation, and internal links.
55
-
1. To apply formatting and ESLint fixes, run `yarn check-all`. This command modifies files and also checks types and generates RSS. Review the resulting changes before committing.
49
+
2. Run `yarn check-all`. (This will apply Prettier and ESLint fixes, validate types, and generate RSS.)
50
+
3. Run `yarn ci-check` to run the same checks as CI.
56
51
57
52
### Push it
58
53
59
54
1.`git add -A && git commit -m "My message"` (replacing `My message` with a commit message, such as `Fix header logo on Android`) to stage and commit your changes
60
-
1.`git push -u origin the-name-of-my-branch` to push the branch to your fork
55
+
1.`git push origin the-name-of-my-branch`
61
56
1. Go to the [react.dev repo](https://github.com/reactjs/react.dev) and you should see recently pushed branches.
62
57
1. Follow GitHub's instructions.
63
58
1. If possible, include screenshots of visual changes. A preview build is triggered after your changes are pushed to GitHub.
64
59
65
60
## Translation
66
61
67
-
If you are interested in translating `react.dev`, see the [translation guide](https://react.dev/community/translations) and [current translation progress](https://translations.react.dev/).
62
+
If you are interested in translating `react.dev`, please see the current translation efforts [here](https://react.dev/community/translations).
68
63
69
64
## License
70
65
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