Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(cn): adding-interactivity #605

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5f404d9
Initial check-in of new React docs and website
rachelnabors Oct 21, 2021
c1fcb07
Update src/components/Seo.tsx
gaearon Oct 22, 2021
ad8086e
Update src/pages/community/meet-the-team.md
gaearon Oct 22, 2021
011f587
fixing social sharing URL and description (#3974)
rachelnabors Oct 22, 2021
cfcb3a2
Fix preconnect link to target search cluster (#3980)
francoischalifour Oct 23, 2021
455d124
fix: googleTranslate breaks sandboxes (#3984)
shrirambalaji Oct 23, 2021
7fcceca
fix: googleTranslate breaking terminal blocks (#3993)
shrirambalaji Oct 24, 2021
ffd8762
Fix typo (#3998)
itaileshem Oct 25, 2021
9644fc9
Merge branch 'beta' into new-beta
QC-L Oct 26, 2021
fb37e6d
Merge branch 'beta' into new-beta
QC-L Oct 26, 2021
84d2c7d
chore: rm extra js, md and content
QC-L Oct 26, 2021
f96395c
chore: rm gatsby-config
QC-L Oct 26, 2021
1bf54f2
fix: consoleBlock text & bg in dark mode (#3983)
shrirambalaji Oct 26, 2021
446c15c
Style scrollbars in dark mode (#3975)
TheOtterlord Oct 26, 2021
e77fdf2
Update index.md
gaearon Oct 27, 2021
3a15647
docs(en): merging all conflicts
docschina-bot Oct 27, 2021
a014660
docs(cn): fix conflicts
QC-L Oct 27, 2021
f883531
docs(en): merge reactjs.org/beta into zh-hans.reactjs.org/beta @ e77f…
QC-L Oct 27, 2021
c0d8f28
Merge remote-tracking branch 'origin/main' into beta
QC-L Oct 27, 2021
b46bdaa
Revert "Style scrollbars in dark mode (#3975)"
gaearon Oct 27, 2021
6bc962e
docs(cn): translate nav, menu and index (#600)
QC-L Oct 28, 2021
d556897
Merge branch 'beta' of https://github.com/reactjs/reactjs.org into sy…
docschina-bot Oct 28, 2021
1d3a9df
docs(cn): adding-interactivity
wenmin92 Oct 28, 2021
039a047
header add anchor
wenmin92 Oct 28, 2021
f6b3406
Update src/pages/learn/adding-interactivity.md
wenmin92 Oct 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 0 additions & 41 deletions .babelrc

This file was deleted.

31 changes: 0 additions & 31 deletions .circleci/config.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .circleci/deploy.sh

This file was deleted.

2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_HJ_SITE_ID = 2411683
NEXT_PUBLIC_HJ_SITE_V = 6
2 changes: 2 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_HJ_SITE_ID = 2411651
NEXT_PUBLIC_HJ_SITE_V = 6
13 changes: 3 additions & 10 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
node_modules/*

# Ignore markdown files and examples
content/*

# Ignore built files
public/*

# Ignore examples
examples/*
scripts
plugins
next.config.js
24 changes: 12 additions & 12 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"extends": [
"fbjs"
"extends": ["react-app", "plugin:jsx-a11y/recommended"],
"plugins": ["jsx-a11y"],
"overrides": [
{
"files": ["**/*.ts?(x)"],
"rules": {
"jsx-a11y/anchor-is-valid": 0
}
}
],
"plugins": [
"prettier",
"react"
],
"parser": "babel-eslint",
"rules": {
"relay/graphql-naming": 0,
"max-len": 0
},
"env": {
"node": true,
"browser": true
"commonjs": true,
"browser": true,
"es6": true
}
}
35 changes: 0 additions & 35 deletions .flowconfig

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
lint:
runs-on: ubuntu-latest

name: Lint on node 12.x and ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint codebase
run: yarn ci-check
40 changes: 34 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
.cache
.DS_STORE
.idea
node_modules
public
yarn-error.log
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/pages/docs/**/*.md
src/pages/blog/**/*.md
9 changes: 4 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"bracketSpacing": false,
"jsxBracketSameLine": true,
"parser": "flow",
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all"
}
"jsxBracketSameLine": true,
"trailingComma": "es5",
"printWidth": 80
}
20 changes: 5 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,9 @@ This is a [good summary](https://medium.com/@kvosswinkel/coding-like-a-journalis

The documentation is divided into sections to cater to different learning styles and use cases. When editing an article, try to match the surrounding text in tone and style. When creating a new article, try to match the tone of the other articles in the same section. Learn about the motivation behind each section below.

**[Installation](https://reactjs.org/docs/getting-started.html)** gives an overview of the docs, and demonstrates two different ways to use it: either as a simple `<script>` tag on the page, or as part of a complex JavaScript toolchain.
**[Learn React](https://beta.reactjs.org/learn)** is designed to introduce fundamental concepts in a step-by-step way. Each individual article in Learn React builds on the knowledge from the previous ones, so make sure not to add any "cyclical dependencies" between them. It is important that the reader can start with the first article and work their way to the last Learn React article without ever having to "look ahead" for a definition. This explains some ordering choices (e.g. that state is explained before events, or that "thinking in React" doesn't use refs). Learn React also serves as a reference manual for React concepts, so it is important to be very strict about their definitions and relationships between them.

**[Tutorial](https://reactjs.org/tutorial/tutorial.html)** is relatively informal, and is designed for people who prefer a hands-on approach to learning, and can tolerate skipping theory in favor of practice. Its goal is to give the reader a feel for a typical React workflow rather than to explain fundamentals in detail. Here we focus on *what* to do and spend less time on *how* or *why* we did it. It is extremely important to do a lot of hand-holding and unambiguously describe every single change. It should be possible for a beginner to mechanically follow every instruction, and still get to a working tic-tac-toe game.

**[Main Concepts](https://reactjs.org/docs/hello-world.html)** is designed to introduce fundamental concepts in a step-by-step way. Each individual article in Main Concepts builds on the knowledge from the previous ones, so make sure not to add any "cyclical dependencies" between them. It is important that the reader can start with the first article and work their way to the last Main Concepts article without ever having to "look ahead" for a definition. This explains some ordering choices (e.g. that state is explained before events, or that "thinking in React" doesn't use refs). Main Concepts also serves as a reference manual for React concepts, so it is important to be very strict about their definitions and relationships between them. This is, for example, why we introduce elements before components. Resist adding too much detail to Main Concepts articles. They intentionally don't cover all corner cases, and focus on establishing firm foundations.

**[Advanced Guides](https://reactjs.org/docs/jsx-in-depth.html)** are deep dives into topics that aren't essential for a beginner developer but that everyone bumps into sooner or later. They don't have a specific order, and target more experienced developers. If you have a set of recipes fitting a particular use case, and those recipes aren't opinionated (most React users would agree on them), this is the place to add them.

**[Reference](https://reactjs.org/docs/react-api.html)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Main Concepts or Advanced Guides should be mentioned in the reference documentation for the corresponding APIs.

**[Contributing](https://reactjs.org/docs/how-to-contribute.html)** should stay up-to-date and be friendly to relatively experienced developers.

**[FAQ](https://reactjs.org/docs/faq-ajax.html)** has a more conversational tone than the other sections. Here, it's fine to include some content that's not primarily concerned with React, as long as React users are overwhelmingly interested in it (e.g. recommendations on directory structure). It's also okay to show more than a single way to do something in the FAQ, and briefly discuss the tradeoffs. The FAQ prioritizes unblocking people with a working solution over explaining concepts in detail, and can be more opinionated than the rest of the docs, even providing popular library recommendations.
**[API Reference](https://reactjs.org/reference)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Learn React should be mentioned in the reference documentation for the corresponding APIs.

**Try to follow your own instructions.**

Expand Down Expand Up @@ -106,7 +96,7 @@ They tell the website to highlight specific lines.
You can highlight a single line:

````
```js{2}
```js {2}
function hello() {
// this line will get highlighted
}
Expand All @@ -116,7 +106,7 @@ function hello() {
A range of lines:

````
```js{2-4}
```js {2-4}
function hello() {
// these lines
// will get
Expand All @@ -128,7 +118,7 @@ function hello() {
Or even multiple ranges:

````
```js{2-4,6}
```js {2-4,6}
function hello() {
// these lines
// will get
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@

### Running locally

1. `yarn dev` to start the hot-reloading development server (powered by [Gatsby](https://www.gatsbyjs.org))
1. `open http://localhost:8000` to open the site in your favorite browser
1. `yarn dev` to start the development server (powered by [Next.js](https://nextjs.org/))
1. `open http://localhost:3000` to open the site in your favorite browser

## Contributing

Expand Down
Loading