diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 40f742563..000000000
--- a/.babelrc
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "presets": [
- [
- "@babel/preset-env",
- {
- "loose": true,
- "modules": false,
- "useBuiltIns": "usage",
- "shippedProposals": true,
- "targets": {
- "browsers": [">0.25%", "not dead"],
- }
- }
- ],
- [
- "@babel/preset-react",
- {
- "useBuiltIns": true,
- "pragma": "React.createElement",
- }
- ],
- "@babel/flow"
- ],
- "plugins": [
- [
- "@babel/plugin-proposal-class-properties",
- {
- "loose": true
- }
- ],
- "@babel/plugin-syntax-dynamic-import",
- "babel-plugin-macros",
- [
- "@babel/plugin-transform-runtime",
- {
- "helpers": true,
- "regenerator": true
- }
- ]
- ]
-}
\ No newline at end of file
diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index 028250472..000000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-version: 2
-jobs:
- build:
- docker:
- - image: circleci/node:12
- steps:
- - checkout
- - restore_cache:
- keys:
- - dependencies-{{ checksum "yarn.lock" }}
- - run:
- name: Install
- command: yarn install --pure-lockfile
- - save_cache:
- paths:
- - node_modules
- key: dependencies-{{ checksum "yarn.lock" }}
- - run:
- name: Check Prettier, ESLint, Flow
- command: yarn ci-check
diff --git a/.env.development b/.env.development
new file mode 100644
index 000000000..a692f21c7
--- /dev/null
+++ b/.env.development
@@ -0,0 +1 @@
+SANDPACK_BARE_COMPONENTS=true
\ No newline at end of file
diff --git a/.env.production b/.env.production
new file mode 100644
index 000000000..445c9c4d0
--- /dev/null
+++ b/.env.production
@@ -0,0 +1,2 @@
+NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4'
+SANDPACK_BARE_COMPONENTS=true
\ No newline at end of file
diff --git a/.eslintignore b/.eslintignore
index 942541715..4738cb697 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,10 +1,3 @@
-node_modules/*
-
-# Ignore markdown files and examples
-content/*
-
-# Ignore built files
-public/*
-
-# Ignore examples
-examples/*
\ No newline at end of file
+scripts
+plugins
+next.config.js
diff --git a/.eslintrc b/.eslintrc
index a51454ef2..147e54607 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,18 +1,16 @@
{
- "extends": [
- "fbjs"
- ],
- "plugins": [
- "prettier",
- "react"
- ],
- "parser": "babel-eslint",
+ "root": true,
+ "extends": "next/core-web-vitals",
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"],
"rules": {
- "relay/graphql-naming": 0,
- "max-len": 0
+ "no-unused-vars": "off",
+ "@typescript-eslint/no-unused-vars": "warn"
},
"env": {
"node": true,
- "browser": true
+ "commonjs": true,
+ "browser": true,
+ "es6": true
}
}
diff --git a/.flowconfig b/.flowconfig
deleted file mode 100644
index 836f6ec1e..000000000
--- a/.flowconfig
+++ /dev/null
@@ -1,35 +0,0 @@
-[ignore]
-
-/content/.*
-/node_modules/.*
-/public/.*
-
-[include]
-
-[libs]
-./node_modules/fbjs/flow/lib/dev.js
-./flow
-
-[options]
-module.system=haste
-module.system.node.resolve_dirname=node_modules
-module.system.node.resolve_dirname=src
-
-esproposal.class_static_fields=enable
-esproposal.class_instance_fields=enable
-unsafe.enable_getters_and_setters=true
-
-munge_underscores=false
-
-suppress_type=$FlowIssue
-suppress_type=$FlowFixMe
-suppress_type=$FixMe
-suppress_type=$FlowExpectedError
-
-suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)
-suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)?:? #[0-9]+
-suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
-suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
-
-[version]
-^0.56.0
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index e34dda4af..7e4f6d2f2 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -4,7 +4,7 @@ Thank you for the PR! Contributors like you keep React awesome!
Please see the Contribution Guide for guidelines:
-https://github.com/reactjs/reactjs.org/blob/main/CONTRIBUTING.md
+https://github.com/reactjs/react.dev/blob/main/CONTRIBUTING.md
If your PR references an existing issue, please add the issue number below
diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml
new file mode 100644
index 000000000..c447a2cdb
--- /dev/null
+++ b/.github/workflows/analyze.yml
@@ -0,0 +1,91 @@
+name: Analyze Bundle
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main # change this if your default branch is named differently
+ workflow_dispatch:
+
+jobs:
+ analyze:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Set up node
+ uses: actions/setup-node@v1
+ with:
+ node-version: "14.x"
+
+ - name: Install dependencies
+ uses: bahmutov/npm-install@v1.7.10
+
+ - name: Restore next build
+ uses: actions/cache@v2
+ id: restore-build-cache
+ env:
+ cache-name: cache-next-build
+ with:
+ path: .next/cache
+ # change this if you prefer a more strict cache
+ key: ${{ runner.os }}-build-${{ env.cache-name }}
+
+ - name: Build next.js app
+ # change this if your site requires a custom build command
+ run: ./node_modules/.bin/next build
+
+ # Here's the first place where next-bundle-analysis' own script is used
+ # This step pulls the raw bundle stats for the current bundle
+ - name: Analyze bundle
+ run: npx -p nextjs-bundle-analysis report
+
+ - name: Upload bundle
+ uses: actions/upload-artifact@v2
+ with:
+ path: .next/analyze/__bundle_analysis.json
+ name: bundle_analysis.json
+
+ - name: Download base branch bundle stats
+ uses: dawidd6/action-download-artifact@v2
+ if: success() && github.event.number
+ with:
+ workflow: analyze.yml
+ branch: ${{ github.event.pull_request.base.ref }}
+ name: bundle_analysis.json
+ path: .next/analyze/base/bundle
+
+ # And here's the second place - this runs after we have both the current and
+ # base branch bundle stats, and will compare them to determine what changed.
+ # There are two configurable arguments that come from package.json:
+ #
+ # - budget: optional, set a budget (bytes) against which size changes are measured
+ # it's set to 350kb here by default, as informed by the following piece:
+ # https://infrequently.org/2021/03/the-performance-inequality-gap/
+ #
+ # - red-status-percentage: sets the percent size increase where you get a red
+ # status indicator, defaults to 20%
+ #
+ # Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
+ # entry in your package.json file.
+ - name: Compare with base branch bundle
+ if: success() && github.event.number
+ run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
+
+ - name: Upload analysis comment
+ uses: actions/upload-artifact@v2
+ with:
+ name: analysis_comment.txt
+ path: .next/analyze/__bundle_analysis_comment.txt
+
+ - name: Save PR number
+ run: echo ${{ github.event.number }} > ./pr_number
+
+ - name: Upload PR number
+ uses: actions/upload-artifact@v2
+ with:
+ name: pr_number
+ path: ./pr_number
+
+ # The actual commenting happens in the other action, matching the guidance in
+ # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
diff --git a/.github/workflows/analyze_comment.yml b/.github/workflows/analyze_comment.yml
new file mode 100644
index 000000000..bd73b6b4e
--- /dev/null
+++ b/.github/workflows/analyze_comment.yml
@@ -0,0 +1,72 @@
+name: Analyze Bundle (Comment)
+
+on:
+ workflow_run:
+ workflows: ["Analyze Bundle"]
+ types:
+ - completed
+
+jobs:
+ comment:
+ runs-on: ubuntu-latest
+ if: >
+ ${{ github.event.workflow_run.event == 'pull_request' &&
+ github.event.workflow_run.conclusion == 'success' }}
+ steps:
+ - name: Download base branch bundle stats
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: analyze.yml
+ run_id: ${{ github.event.workflow_run.id }}
+ name: analysis_comment.txt
+ path: analysis_comment.txt
+
+ - name: Download PR number
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: analyze.yml
+ run_id: ${{ github.event.workflow_run.id }}
+ name: pr_number
+ path: pr_number
+
+ - name: Get comment body
+ id: get-comment-body
+ if: success()
+ run: |
+ echo 'body<> $GITHUB_OUTPUT
+ echo '' >> $GITHUB_OUTPUT
+ echo '## Size changes' >> $GITHUB_OUTPUT
+ echo '' >> $GITHUB_OUTPUT
+ echo '' >> $GITHUB_OUTPUT
+ echo '' >> $GITHUB_OUTPUT
+ cat analysis_comment.txt/__bundle_analysis_comment.txt >> $GITHUB_OUTPUT
+ echo '' >> $GITHUB_OUTPUT
+ echo '' >> $GITHUB_OUTPUT
+ echo '' >> $GITHUB_OUTPUT
+ echo 'EOF' >> $GITHUB_OUTPUT
+ pr_number=$(cat pr_number/pr_number)
+ echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
+
+ - name: Find Comment
+ uses: peter-evans/find-comment@v1
+ if: success()
+ id: fc
+ with:
+ issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
+ body-includes: ""
+
+ - name: Create Comment
+ uses: peter-evans/create-or-update-comment@v1.4.4
+ if: success() && steps.fc.outputs.comment-id == 0
+ with:
+ issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
+ body: ${{ steps.get-comment-body.outputs.body }}
+
+ - name: Update Comment
+ uses: peter-evans/create-or-update-comment@v1.4.4
+ if: success() && steps.fc.outputs.comment-id != 0
+ with:
+ issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
+ body: ${{ steps.get-comment-body.outputs.body }}
+ comment-id: ${{ steps.fc.outputs.comment-id }}
+ edit-mode: replace
diff --git a/.github/workflows/site_lint.yml b/.github/workflows/site_lint.yml
new file mode 100644
index 000000000..bf446393a
--- /dev/null
+++ b/.github/workflows/site_lint.yml
@@ -0,0 +1,27 @@
+name: Site Lint / Heading ID check
+
+on:
+ push:
+ branches:
+ - main # change this if your default branch is named differently
+ 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.7.10
+
+ - name: Lint codebase
+ run: yarn ci-check
diff --git a/.gitignore b/.gitignore
index d1bde99ce..d8bec488b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,38 @@
-.cache
-.DS_STORE
-.idea
-node_modules
-public
-yarn-error.log
\ No newline at end of file
+# 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
+tsconfig.tsbuildinfo
+
+# 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
+
+# external fonts
+public/fonts/**/Optimistic_*.woff2
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 000000000..dc0378c34
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,4 @@
+#!/bin/sh
+. "$(dirname "$0")/_/husky.sh"
+
+yarn lint-staged
\ No newline at end of file
diff --git a/.nvmrc b/.nvmrc
deleted file mode 100644
index 66df3b7ab..000000000
--- a/.nvmrc
+++ /dev/null
@@ -1 +0,0 @@
-12.16.1
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 000000000..96f1f96d2
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1 @@
+src/content/**/*.md
diff --git a/.prettierrc b/.prettierrc
index eb91e6abb..19b54ad05 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,8 +1,21 @@
{
"bracketSpacing": false,
- "jsxBracketSameLine": true,
- "parser": "flow",
- "printWidth": 80,
"singleQuote": true,
- "trailingComma": "all"
-}
\ No newline at end of file
+ "bracketSameLine": true,
+ "trailingComma": "es5",
+ "printWidth": 80,
+ "overrides": [
+ {
+ "files": "*.css",
+ "options": {
+ "parser": "css"
+ }
+ },
+ {
+ "files": "*.md",
+ "options": {
+ "parser": "mdx"
+ }
+ }
+ ]
+}
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e10f4f53e..0e861af35 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -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 `
-
-## CoffeeScript integration {#coffeescript-integration}
-
-[Vjeux](http://blog.vjeux.com/) used the fact that JSX is just a syntactic sugar on-top of regular JS to rewrite the React front-page examples in CoffeeScript.
-
-> Multiple people asked what's the story about JSX and CoffeeScript. There is no JSX pre-processor for CoffeeScript and I'm not aware of anyone working on it. Fortunately, CoffeeScript is pretty expressive and we can play around the syntax to come up with something that is usable.
->
-> ```javascript
-> {div, h3, textarea} = React.DOM
-> (div {className: 'MarkdownEditor'}, [
-> (h3 {}, 'Input'),
-> (textarea {onKeyUp: @handleKeyUp, ref: 'textarea'},
-> @state.value
-> )
-> ])
-> ```
->
-> [Read the full post...](http://blog.vjeux.com/2013/javascript/react-coffeescript.html)
-
-## Tutorial in Plain JavaScript {#tutorial-in-plain-javascript}
-
-We've seen a lot of people comparing React with various frameworks. [Ricardo Tomasi](http://ricardo.cc/) decided to re-implement the tutorial without any framework, just plain JavaScript.
-
-> Facebook & Instagram launched the React framework and an accompanying tutorial. Developer Vlad Yazhbin decided to rewrite that using AngularJS. The end result is pretty neat, but if you're like me you will not actually appreciate the HTML speaking for itself and doing all the hard work. So let's see what that looks like in plain javascript.
->
-> [Read the full post...](http://ricardo.cc/2013/06/07/react-tutorial-rewritten-in-plain-javascript.html)
diff --git a/content/blog/2013-07-02-react-v0-4-autobind-by-default.md b/content/blog/2013-07-02-react-v0-4-autobind-by-default.md
deleted file mode 100644
index 9c98fd9b2..000000000
--- a/content/blog/2013-07-02-react-v0-4-autobind-by-default.md
+++ /dev/null
@@ -1,51 +0,0 @@
----
-title: "New in React v0.4: Autobind by Default"
-author: [zpao]
----
-
-React v0.4 is very close to completion. As we finish it off, we'd like to share with you some of the major changes we've made since v0.3. This is the first of several posts we'll be making over the next week.
-
-
-## What is React.autoBind? {#what-is-reactautobind}
-
-If you take a look at most of our current examples, you'll see us using `React.autoBind` for event handlers. This is used in place of `Function.prototype.bind`. Remember that in JS, [function calls are late-bound](https://bonsaiden.github.io/JavaScript-Garden/#function.this). That means that if you simply pass a function around, the `this` used inside won't necessarily be the `this` you expect. `Function.prototype.bind` creates a new, properly bound, function so that when called, `this` is exactly what you expect it to be.
-
-Before we launched React, we would write this:
-
-```js{4}
-React.createClass({
- onClick: function(event) {/* do something with this */},
- render: function() {
- return ;
- }
-});
-```
-
-We wrote `React.autoBind` as a way to cache the function creation and save on memory usage. Since `render` can get called multiple times, if you used `this.onClick.bind(this)` you would actually create a new function on each pass. With React v0.3 you were able to write this instead:
-
-```js{2,4}
-React.createClass({
- onClick: React.autoBind(function(event) {/* do something with this */}),
- render: function() {
- return ;
- }
-});
-```
-
-
-## What's Changing in v0.4? {#whats-changing-in-v04}
-
-After using `React.autoBind` for a few weeks, we realized that there were very few times that we didn't want that behavior. So we made it the default! Now all methods defined within `React.createClass` will already be bound to the correct instance.
-
-Starting with v0.4 you can just write this:
-
-```js{2,4}
-React.createClass({
- onClick: function(event) {/* do something with this */},
- render: function() {
- return ;
- }
-});
-```
-
-For v0.4 we will simply be making `React.autoBind` a no-op — it will just return the function you pass to it. Most likely you won't have to change your code to account for this change, though we encourage you to update. We'll publish a migration guide documenting this and other changes that come along with React v0.4.
diff --git a/content/blog/2013-07-03-community-roundup-4.md b/content/blog/2013-07-03-community-roundup-4.md
deleted file mode 100644
index b7bd158c2..000000000
--- a/content/blog/2013-07-03-community-roundup-4.md
+++ /dev/null
@@ -1,58 +0,0 @@
----
-title: "Community Round-up #4"
-author: [vjeux]
----
-
-React reconciliation process appears to be very well suited to implement a text editor with a live preview as people at Khan Academy show us.
-
-## Khan Academy {#khan-academy}
-
-[Ben Kamens](http://bjk5.com/) explains how [Sophie Alpert](http://sophiebits.com/) and [Joel Burget](http://joelburget.com/) are promoting React inside of [Khan Academy](https://www.khanacademy.org/). They now have three projects in the works using React.
-
-> Recently two Khan Academy devs dropped into our team chat and said they were gonna use React to write a new feature. They even hinted that we may want to adopt it product-wide.
->
-> "The library is only a week old. It's a brand new way of thinking about things. We're the first to use it outside of Facebook. Heck, even the React devs were surprised to hear we're using this in production!!!"
->
-> [Read the full post...](http://bjk5.com/post/53742233351/getting-your-team-to-adopt-new-technology)
-
-The best part is the demo of how React reconciliation process makes live editing more user-friendly.
-
-> Our renderer, post-React, is on the left. A typical math editor's preview is on the right.
-
-[](http://bjk5.com/post/53742233351/getting-your-team-to-adopt-new-technology)
-
-## React Snippets {#react-snippets}
-
-Over the past several weeks, members of our team, [Pete Hunt](http://www.petehunt.net/) and [Paul O'Shannessy](http://zpao.com/), answered many questions that were asked in the [React group](https://groups.google.com/forum/#!forum/reactjs). They give a good overview of how to integrate React with other libraries and APIs through the use of [Mixins](/docs/reusable-components.html) and [Lifecycle Methods](/docs/working-with-the-browser.html).
-
-> [Listening Scroll Event](https://groups.google.com/forum/#!topic/reactjs/l6PnP8qbofk)
->
-> * [JSFiddle](http://jsfiddle.net/aabeL/1/): Basically I've given you two mixins. The first lets you react to global scroll events. The second is, IMO, much more useful: it gives you scroll start and scroll end events, which you can use with setState() to create components that react based on whether the user is scrolling or not.
->
-> [Fade-in Transition](https://groups.google.com/forum/#!topic/reactjs/RVAY_eQmdpo)
->
-> * [JSFiddle](http://jsfiddle.net/ufe8k/1/): Creating a new `` component and using jQuery `.fadeIn()` function on the DOM node.
-> * [JSFiddle](http://jsfiddle.net/R8f5L/5/): Using CSS transition instead.
->
-> [Socket.IO Integration](https://groups.google.com/forum/#!topic/reactjs/pyUZBRWcHB4)
->
-> * [Gist](https://gist.github.com/zpao/5686416): The big thing to notice is that my component is pretty dumb (it doesn't have to be but that's how I chose to model it). All it does is render itself based on the props that are passed in. renderOrUpdate is where the "magic" happens.
-> * [Gist](https://gist.github.com/petehunt/5687230): This example is doing everything -- including the IO -- inside of a single React component.
-> * [Gist](https://gist.github.com/petehunt/5687276): One pattern that we use at Instagram a lot is to employ separation of concerns and consolidate I/O and state into components higher in the hierarchy to keep the rest of the components mostly stateless and purely display.
->
-> [Sortable jQuery Plugin Integration](https://groups.google.com/forum/#!topic/reactjs/mHfBGI3Qwz4)
->
-> * [JSFiddle](http://jsfiddle.net/LQxy7/): Your React component simply render empty divs, and then in componentDidMount() you call React.renderComponent() on each of those divs to set up a new root React tree. Be sure to explicitly unmountAndReleaseReactRootNode() for each component in componentWillUnmount().
-
-## Introduction to React Screencast {#introduction-to-react-screencast}
-
-[Pete Hunt](http://www.petehunt.net/) recorded himself implementing a simple `
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/brave-villani-ypxvf)**
-
-Notice how when you type into the input, the `` component suspends, and we see the `
Loading...
` fallback until we get fresh results. This is not ideal. It would be better if we could see the *previous* translation for a bit while we're fetching the next one.
-
-In fact, if we open the console, we'll see a warning:
-
-```
-Warning: App triggered a user-blocking update that suspended.
-
-The fix is to split the update into multiple parts: a user-blocking update to provide immediate feedback, and another update that triggers the bulk of the changes.
-
-Refer to the documentation for useTransition to learn how to implement this pattern.
-```
-
-As we mentioned earlier, if some state update causes a component to suspend, that state update should be wrapped in a transition. Let's add `useTransition` to our component:
-
-```js{4-6,10,13}
-function App() {
- const [query, setQuery] = useState(initialQuery);
- const [resource, setResource] = useState(initialResource);
- const [startTransition, isPending] = useTransition({
- timeoutMs: 5000
- });
-
- function handleChange(e) {
- const value = e.target.value;
- startTransition(() => {
- setQuery(value);
- setResource(fetchTranslation(value));
- });
- }
-
- // ...
-
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/zen-keldysh-rifos)**
-
-Try typing into the input now. Something's wrong! The input is updating very slowly.
-
-We've fixed the first problem (suspending outside of a transition). But now because of the transition, our state doesn't update immediately, and it can't "drive" a controlled input!
-
-The answer to this problem **is to split the state in two parts:** a "high priority" part that updates immediately, and a "low priority" part that may wait for a transition.
-
-In our example, we already have two state variables. The input text is in `query`, and we read the translation from `resource`. We want changes to the `query` state to happen immediately, but changes to the `resource` (i.e. fetching a new translation) should trigger a transition.
-
-So the correct fix is to put `setQuery` (which doesn't suspend) *outside* the transition, but `setResource` (which will suspend) *inside* of it.
-
-```js{4,5}
-function handleChange(e) {
- const value = e.target.value;
-
- // Outside the transition (urgent)
- setQuery(value);
-
- startTransition(() => {
- // Inside the transition (may be delayed)
- setResource(fetchTranslation(value));
- });
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/lively-smoke-fdf93)**
-
-With this change, it works as expected. We can type into the input immediately, and the translation later "catches up" to what we have typed.
-
-### Deferring a Value {#deferring-a-value}
-
-By default, React always renders a consistent UI. Consider code like this:
-
-```js
-<>
-
-
->
-```
-
-React guarantees that whenever we look at these components on the screen, they will reflect data from the same `user`. If a different `user` is passed down because of a state update, you would see them changing together. You can't ever record a screen and find a frame where they would show values from different `user`s. (If you ever run into a case like this, file a bug!)
-
-This makes sense in the vast majority of situations. Inconsistent UI is confusing and can mislead users. (For example, it would be terrible if a messenger's Send button and the conversation picker pane "disagreed" about which thread is currently selected.)
-
-However, sometimes it might be helpful to intentionally introduce an inconsistency. We could do it manually by "splitting" the state like above, but React also offers a built-in Hook for this:
-
-```js
-import { useDeferredValue } from 'react';
-
-const deferredValue = useDeferredValue(value, {
- timeoutMs: 5000
-});
-```
-
-To demonstrate this feature, we'll use [the profile switcher example](https://codesandbox.io/s/musing-ramanujan-bgw2o). Click the "Next" button and notice how it takes 1 second to do a transition.
-
-Let's say that fetching the user details is very fast and only takes 300 milliseconds. Currently, we're waiting a whole second because we need both user details and posts to display a consistent profile page. But what if we want to show the details faster?
-
-If we're willing to sacrifice consistency, we could **pass potentially stale data to the components that delay our transition**. That's what `useDeferredValue()` lets us do:
-
-```js{2-4,10,11,21}
-function ProfilePage({ resource }) {
- const deferredResource = useDeferredValue(resource, {
- timeoutMs: 1000
- });
- return (
- Loading profile...}>
-
- Loading posts...}>
-
-
-
- );
-}
-
-function ProfileTimeline({ isStale, resource }) {
- const posts = resource.posts.read();
- return (
-
- {posts.map(post => (
-
{post.text}
- ))}
-
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/vigorous-keller-3ed2b)**
-
-The tradeoff we're making here is that `` will be inconsistent with other components and potentially show an older item. Click "Next" a few times, and you'll notice it. But thanks to that, we were able to cut down the transition time from 1000ms to 300ms.
-
-Whether or not it's an appropriate tradeoff depends on the situation. But it's a handy tool, especially when the content doesn't change noticeably between items, and the user might not even realize they were looking at a stale version for a second.
-
-It's worth noting that `useDeferredValue` is not *only* useful for data fetching. It also helps when an expensive component tree causes an interaction (e.g. typing in an input) to be sluggish. Just like we can "defer" a value that takes too long to fetch (and show its old value despite other components updating), we can do this with trees that take too long to render.
-
-For example, consider a filterable list like this:
-
-```js
-function App() {
- const [text, setText] = useState("hello");
-
- function handleChange(e) {
- setText(e.target.value);
- }
-
- return (
-
-
- ...
-
-
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/pensive-shirley-wkp46)**
-
-In this example, **every item in `` has an artificial slowdown -- each of them blocks the thread for a few milliseconds**. We'd never do this in a real app, but this helps us simulate what can happen in a deep component tree with no single obvious place to optimize.
-
-We can see how typing in the input causes stutter. Now let's add `useDeferredValue`:
-
-```js{3-5,18}
-function App() {
- const [text, setText] = useState("hello");
- const deferredText = useDeferredValue(text, {
- timeoutMs: 5000
- });
-
- function handleChange(e) {
- setText(e.target.value);
- }
-
- return (
-
-
- ...
-
-
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/infallible-dewdney-9fkv9)**
-
-Now typing has a lot less stutter -- although we pay for this by showing the results with a lag.
-
-How is this different from debouncing? Our example has a fixed artificial delay (3ms for every one of 80 items), so there is always a delay, no matter how fast our computer is. However, the `useDeferredValue` value only "lags behind" if the rendering takes a while. There is no minimal lag imposed by React. With a more realistic workload, you can expect the lag to adjust to the user’s device. On fast machines, the lag would be smaller or non-existent, and on slow machines, it would be more noticeable. In both cases, the app would remain responsive. That’s the advantage of this mechanism over debouncing or throttling, which always impose a minimal delay and can't avoid blocking the thread while rendering.
-
-Even though there is an improvement in responsiveness, this example isn't as compelling yet because Concurrent Mode is missing some crucial optimizations for this use case. Still, it is interesting to see that features like `useDeferredValue` (or `useTransition`) are useful regardless of whether we're waiting for network or for computational work to finish.
-
-### SuspenseList {#suspenselist}
-
-`` is the last pattern that's related to orchestrating loading states.
-
-Consider this example:
-
-```js{5-10}
-function ProfilePage({ resource }) {
- return (
- <>
-
- Loading posts...}>
-
-
- Loading fun facts...}>
-
-
- >
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/proud-tree-exg5t)**
-
-The API call duration in this example is randomized. If you keep refreshing it, you will notice that sometimes the posts arrive first, and sometimes the "fun facts" arrive first.
-
-This presents a problem. If the response for fun facts arrives first, we'll see the fun facts below the `
Loading posts...
` fallback for posts. We might start reading them, but then the *posts* response will come back, and shift all the facts down. This is jarring.
-
-One way we could fix it is by putting them both in a single boundary:
-
-```js
-Loading posts and fun facts...}>
-
-
-
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/currying-violet-5jsiy)**
-
-The problem with this is that now we *always* wait for both of them to be fetched. However, if it's the *posts* that came back first, there's no reason to delay showing them. When fun facts load later, they won't shift the layout because they're already below the posts.
-
-Other approaches to this, such as composing Promises in a special way, are increasingly difficult to pull off when the loading states are located in different components down the tree.
-
-To solve this, we will import `SuspenseList`:
-
-```js
-import { SuspenseList } from 'react';
-```
-
-`` coordinates the "reveal order" of the closest `` nodes below it:
-
-```js{3,11}
-function ProfilePage({ resource }) {
- return (
-
-
- Loading posts...}>
-
-
- Loading fun facts...}>
-
-
-
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/black-wind-byilt)**
-
-The `revealOrder="forwards"` option means that the closest `` nodes inside this list **will only "reveal" their content in the order they appear in the tree -- even if the data for them arrives in a different order**. `` has other interesting modes: try changing `"forwards"` to `"backwards"` or `"together"` and see what happens.
-
-You can control how many loading states are visible at once with the `tail` prop. If we specify `tail="collapsed"`, we'll see *at most one* fallback at a time. You can play with it [here](https://codesandbox.io/s/adoring-almeida-1zzjh).
-
-Keep in mind that `` is composable, like anything in React. For example, you can create a grid by putting several `` rows inside a `` table.
-
-## Next Steps {#next-steps}
-
-Concurrent Mode offers a powerful UI programming model and a set of new composable primitives to help you orchestrate delightful user experiences.
-
-It's a result of several years of research and development, but it's not finished. In the section on [adopting Concurrent Mode](/docs/concurrent-mode-adoption.html), we'll describe how you can try it and what you can expect.
diff --git a/content/docs/concurrent-mode-reference.md b/content/docs/concurrent-mode-reference.md
deleted file mode 100644
index 09fb109f7..000000000
--- a/content/docs/concurrent-mode-reference.md
+++ /dev/null
@@ -1,204 +0,0 @@
----
-id: concurrent-mode-reference
-title: Concurrent Mode API Reference (Experimental)
-permalink: docs/concurrent-mode-reference.html
-prev: concurrent-mode-adoption.html
----
-
-
-
-
-
->Caution:
->
->This page was about experimental features that aren't yet available in a stable release. It was aimed at early adopters and people who are curious.
->
->Much of the information on this page is now outdated and exists only for archival purposes. **Please refer to the [React 18 Alpha announcement post](/blog/2021/06/08/the-plan-for-react-18.html
-) for the up-to-date information.**
->
->Before React 18 is released, we will replace this page with stable documentation.
-
-
-
-This page is an API reference for the React [Concurrent Mode](/docs/concurrent-mode-intro.html). If you're looking for a guided introduction instead, check out [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html).
-
-**Note: This is a Community Preview and not the final stable version. There will likely be future changes to these APIs. Use at your own risk!**
-
-- [Enabling Concurrent Mode](#concurrent-mode)
- - [`createRoot`](#createroot)
-- [Suspense](#suspense)
- - [`Suspense`](#suspensecomponent)
- - [`SuspenseList`](#suspenselist)
- - [`useTransition`](#usetransition)
- - [`useDeferredValue`](#usedeferredvalue)
-
-## Enabling Concurrent Mode {#concurrent-mode}
-
-### `createRoot` {#createroot}
-
-```js
-ReactDOM.createRoot(rootNode).render();
-```
-
-Replaces `ReactDOM.render(, rootNode)` and enables Concurrent Mode.
-
-For more information on Concurrent Mode, check out the [Concurrent Mode documentation.](/docs/concurrent-mode-intro.html)
-
-## Suspense API {#suspense}
-
-### `Suspense` {#suspensecomponent}
-
-```js
-Loading...}>
-
-
-
-```
-
-`Suspense` lets your components "wait" for something before they can render, showing a fallback while waiting.
-
-In this example, `ProfileDetails` is waiting for an asynchronous API call to fetch some data. While we wait for `ProfileDetails` and `ProfilePhoto`, we will show the `Loading...` fallback instead. It is important to note that until all children inside `` have loaded, we will continue to show the fallback.
-
-`Suspense` takes two props:
-* **fallback** takes a loading indicator. The fallback is shown until all of the children of the `Suspense` component have finished rendering.
-* **unstable_avoidThisFallback** takes a boolean. It tells React whether to "skip" revealing this boundary during the initial load. This API will likely be removed in a future release.
-
-### `` {#suspenselist}
-
-```js
-
-
-
-
-
-
-
-
-
-
- ...
-
-```
-
-`SuspenseList` helps coordinate many components that can suspend by orchestrating the order in which these components are revealed to the user.
-
-When multiple components need to fetch data, this data may arrive in an unpredictable order. However, if you wrap these items in a `SuspenseList`, React will not show an item in the list until previous items have been displayed (this behavior is adjustable).
-
-`SuspenseList` takes two props:
-* **revealOrder (forwards, backwards, together)** defines the order in which the `SuspenseList` children should be revealed.
- * `together` reveals *all* of them when they're ready instead of one by one.
-* **tail (collapsed, hidden)** dictates how unloaded items in a `SuspenseList` is shown.
- * By default, `SuspenseList` will show all fallbacks in the list.
- * `collapsed` shows only the next fallback in the list.
- * `hidden` doesn't show any unloaded items.
-
-Note that `SuspenseList` only operates on the closest `Suspense` and `SuspenseList` components below it. It does not search for boundaries deeper than one level. However, it is possible to nest multiple `SuspenseList` components in each other to build grids.
-
-### `useTransition` {#usetransition}
-
-```js
-const SUSPENSE_CONFIG = { timeoutMs: 2000 };
-
-const [startTransition, isPending] = useTransition(SUSPENSE_CONFIG);
-```
-
-`useTransition` allows components to avoid undesirable loading states by waiting for content to load before **transitioning to the next screen**. It also allows components to defer slower, data fetching updates until subsequent renders so that more crucial updates can be rendered immediately.
-
-The `useTransition` hook returns two values in an array.
-* `startTransition` is a function that takes a callback. We can use it to tell React which state we want to defer.
-* `isPending` is a boolean. It's React's way of informing us whether we're waiting for the transition to finish.
-
-**If some state update causes a component to suspend, that state update should be wrapped in a transition.**
-
-```js
-const SUSPENSE_CONFIG = { timeoutMs: 2000 };
-
-function App() {
- const [resource, setResource] = useState(initialResource);
- const [startTransition, isPending] = useTransition(SUSPENSE_CONFIG);
- return (
- <>
-
- {isPending ? " Loading..." : null}
- }>
-
-
- >
- );
-}
-```
-
-In this code, we've wrapped our data fetching with `startTransition`. This allows us to start fetching the profile data right away, while deferring the render of the next profile page and its associated `Spinner` for 2 seconds (the time shown in `timeoutMs`).
-
-The `isPending` boolean lets React know that our component is transitioning, so we are able to let the user know this by showing some loading text on the previous profile page.
-
-**For an in-depth look at transitions, you can read [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html#transitions).**
-
-#### useTransition Config {#usetransition-config}
-
-```js
-const SUSPENSE_CONFIG = { timeoutMs: 2000 };
-```
-
-`useTransition` accepts an **optional Suspense Config** with a `timeoutMs`. This timeout (in milliseconds) tells React how long to wait before showing the next state (the new Profile Page in the above example).
-
-**Note: We recommend that you share Suspense Config between different modules.**
-
-
-### `useDeferredValue` {#usedeferredvalue}
-
-```js
-const deferredValue = useDeferredValue(value, { timeoutMs: 2000 });
-```
-
-Returns a deferred version of the value that may "lag behind" it for at most `timeoutMs`.
-
-This is commonly used to keep the interface responsive when you have something that renders immediately based on user input and something that needs to wait for a data fetch.
-
-A good example of this is a text input.
-
-```js
-function App() {
- const [text, setText] = useState("hello");
- const deferredText = useDeferredValue(text, { timeoutMs: 2000 });
-
- return (
-
- {/* Keep passing the current text to the input */}
-
- ...
- {/* But the list is allowed to "lag behind" when necessary */}
-
-
- );
- }
-```
-
-This allows us to start showing the new text for the `input` immediately, which allows the webpage to feel responsive. Meanwhile, `MySlowList` "lags behind" for up to 2 seconds according to the `timeoutMs` before updating, allowing it to render with the current text in the background.
-
-**For an in-depth look at deferring values, you can read [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html#deferring-a-value).**
-
-#### useDeferredValue Config {#usedeferredvalue-config}
-
-```js
-const SUSPENSE_CONFIG = { timeoutMs: 2000 };
-```
-
-`useDeferredValue` accepts an **optional Suspense Config** with a `timeoutMs`. This timeout (in milliseconds) tells React how long the deferred value is allowed to lag behind.
-
-React will always try to use a shorter lag when network and device allows it.
diff --git a/content/docs/concurrent-mode-suspense.md b/content/docs/concurrent-mode-suspense.md
deleted file mode 100644
index 4e1e8c538..000000000
--- a/content/docs/concurrent-mode-suspense.md
+++ /dev/null
@@ -1,739 +0,0 @@
----
-id: concurrent-mode-suspense
-title: Suspense for Data Fetching (Experimental)
-permalink: docs/concurrent-mode-suspense.html
-prev: concurrent-mode-intro.html
-next: concurrent-mode-patterns.html
----
-
-
-
-
-
->Caution:
->
->This page was about experimental features that aren't yet available in a stable release. It was aimed at early adopters and people who are curious.
->
->Much of the information on this page is now outdated and exists only for archival purposes. **Please refer to the [React 18 Alpha announcement post](/blog/2021/06/08/the-plan-for-react-18.html
-) for the up-to-date information.**
->
->Before React 18 is released, we will replace this page with stable documentation.
-
-
-
-React 16.6 added a `` component that lets you "wait" for some code to load and declaratively specify a loading state (like a spinner) while we're waiting:
-
-```jsx
-const ProfilePage = React.lazy(() => import('./ProfilePage')); // Lazy-loaded
-
-// Show a spinner while the profile is loading
-}>
-
-
-```
-
-Suspense for Data Fetching is a new feature that lets you also use `` to **declaratively "wait" for anything else, including data.** This page focuses on the data fetching use case, but it can also wait for images, scripts, or other asynchronous work.
-
-- [What Is Suspense, Exactly?](#what-is-suspense-exactly)
- - [What Suspense Is Not](#what-suspense-is-not)
- - [What Suspense Lets You Do](#what-suspense-lets-you-do)
-- [Using Suspense in Practice](#using-suspense-in-practice)
- - [What If I Don’t Use Relay?](#what-if-i-dont-use-relay)
- - [For Library Authors](#for-library-authors)
-- [Traditional Approaches vs Suspense](#traditional-approaches-vs-suspense)
- - [Approach 1: Fetch-on-Render (not using Suspense)](#approach-1-fetch-on-render-not-using-suspense)
- - [Approach 2: Fetch-Then-Render (not using Suspense)](#approach-2-fetch-then-render-not-using-suspense)
- - [Approach 3: Render-as-You-Fetch (using Suspense)](#approach-3-render-as-you-fetch-using-suspense)
-- [Start Fetching Early](#start-fetching-early)
- - [We’re Still Figuring This Out](#were-still-figuring-this-out)
-- [Suspense and Race Conditions](#suspense-and-race-conditions)
- - [Race Conditions with useEffect](#race-conditions-with-useeffect)
- - [Race Conditions with componentDidUpdate](#race-conditions-with-componentdidupdate)
- - [The Problem](#the-problem)
- - [Solving Race Conditions with Suspense](#solving-race-conditions-with-suspense)
-- [Handling Errors](#handling-errors)
-- [Next Steps](#next-steps)
-
-## What Is Suspense, Exactly? {#what-is-suspense-exactly}
-
-Suspense lets your components "wait" for something before they can render. In [this example](https://codesandbox.io/s/frosty-hermann-bztrp), two components wait for an asynchronous API call to fetch some data:
-
-```js
-const resource = fetchProfileData();
-
-function ProfilePage() {
- return (
- Loading profile...}>
-
- Loading posts...}>
-
-
-
- );
-}
-
-function ProfileDetails() {
- // Try to read user info, although it might not have loaded yet
- const user = resource.user.read();
- return
{user.name}
;
-}
-
-function ProfileTimeline() {
- // Try to read posts, although they might not have loaded yet
- const posts = resource.posts.read();
- return (
-
- {posts.map(post => (
-
{post.text}
- ))}
-
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/frosty-hermann-bztrp)**
-
-This demo is a teaser. Don't worry if it doesn't quite make sense yet. We'll talk more about how it works below. Keep in mind that Suspense is more of a *mechanism*, and particular APIs like `fetchProfileData()` or `resource.posts.read()` in the above example are not very important. If you're curious, you can find their definitions right in the [demo sandbox](https://codesandbox.io/s/frosty-hermann-bztrp).
-
-Suspense is not a data fetching library. It's a **mechanism for data fetching libraries** to communicate to React that *the data a component is reading is not ready yet*. React can then wait for it to be ready and update the UI. At Facebook, we use Relay and its [new Suspense integration](https://relay.dev/docs/en/experimental/step-by-step). We expect that other libraries like Apollo can provide similar integrations.
-
-In the long term, we intend Suspense to become the primary way to read asynchronous data from components -- no matter where that data is coming from.
-
-### What Suspense Is Not {#what-suspense-is-not}
-
-Suspense is significantly different from existing approaches to these problems, so reading about it for the first time often leads to misconceptions. Let's clarify the most common ones:
-
- * **It is not a data fetching implementation.** It does not assume that you use GraphQL, REST, or any other particular data format, library, transport, or protocol.
-
- * **It is not a ready-to-use client.** You can't "replace" `fetch` or Relay with Suspense. But you can use a library that's integrated with Suspense (for example, [new Relay APIs](https://relay.dev/docs/en/experimental/api-reference)).
-
- * **It does not couple data fetching to the view layer.** It helps orchestrate displaying the loading states in your UI, but it doesn't tie your network logic to React components.
-
-### What Suspense Lets You Do {#what-suspense-lets-you-do}
-
-So what's the point of Suspense? There are a few ways we can answer this:
-
-* **It lets data fetching libraries deeply integrate with React.** If a data fetching library implements Suspense support, using it from React components feels very natural.
-
-* **It lets you orchestrate intentionally designed loading states.** It doesn't say _how_ the data is fetched, but it lets you closely control the visual loading sequence of your app.
-
-* **It helps you avoid race conditions.** Even with `await`, asynchronous code is often error-prone. Suspense feels more like reading data *synchronously* — as if it were already loaded.
-
-## Using Suspense in Practice {#using-suspense-in-practice}
-
-At Facebook, so far we have only used the Relay integration with Suspense in production. **If you're looking for a practical guide to get started today, [check out the Relay Guide](https://relay.dev/docs/en/experimental/step-by-step)!** It demonstrates patterns that have already worked well for us in production.
-
-**The code demos on this page use a "fake" API implementation rather than Relay.** This makes them easier to understand if you're not familiar with GraphQL, but they won't tell you the "right way" to build an app with Suspense. This page is more conceptual and is intended to help you see *why* Suspense works in a certain way, and which problems it solves.
-
-### What If I Don't Use Relay? {#what-if-i-dont-use-relay}
-
-If you don't use Relay today, you might have to wait before you can really try Suspense in your app. So far, it's the only implementation that we tested in production and are confident in.
-
-Over the next several months, many libraries will appear with different takes on Suspense APIs. **If you prefer to learn when things are more stable, you might prefer to ignore this work for now, and come back when the Suspense ecosystem is more mature.**
-
-You can also write your own integration for a data fetching library, if you'd like.
-
-### For Library Authors {#for-library-authors}
-
-We expect to see a lot of experimentation in the community with other libraries. There is one important thing to note for data fetching library authors.
-
-Although it's technically doable, Suspense is **not** currently intended as a way to start fetching data when a component renders. Rather, it lets components express that they're "waiting" for data that is *already being fetched*. **[Building Great User Experiences with Concurrent Mode and Suspense](/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense.html) describes why this matters and how to implement this pattern in practice.**
-
-Unless you have a solution that helps prevent waterfalls, we suggest to prefer APIs that favor or enforce fetching before render. For a concrete example, you can look at how [Relay Suspense API](https://relay.dev/docs/en/experimental/api-reference#usepreloadedquery) enforces preloading. Our messaging about this hasn't been very consistent in the past. Suspense for Data Fetching is still experimental, so you can expect our recommendations to change over time as we learn more from production usage and understand the problem space better.
-
-## Traditional Approaches vs Suspense {#traditional-approaches-vs-suspense}
-
-We could introduce Suspense without mentioning the popular data fetching approaches. However, this makes it more difficult to see which problems Suspense solves, why these problems are worth solving, and how Suspense is different from the existing solutions.
-
-Instead, we'll look at Suspense as a logical next step in a sequence of approaches:
-
-* **Fetch-on-render (for example, `fetch` in `useEffect`):** Start rendering components. Each of these components may trigger data fetching in their effects and lifecycle methods. This approach often leads to "waterfalls".
-* **Fetch-then-render (for example, Relay without Suspense):** Start fetching all the data for the next screen as early as possible. When the data is ready, render the new screen. We can't do anything until the data arrives.
-* **Render-as-you-fetch (for example, Relay with Suspense):** Start fetching all the required data for the next screen as early as possible, and start rendering the new screen *immediately — before we get a network response*. As data streams in, React retries rendering components that still need data until they're all ready.
-
->Note
->
->This is a bit simplified, and in practice solutions tend to use a mix of different approaches. Still, we will look at them in isolation to better contrast their tradeoffs.
-
-To compare these approaches, we'll implement a profile page with each of them.
-
-### Approach 1: Fetch-on-Render (not using Suspense) {#approach-1-fetch-on-render-not-using-suspense}
-
-A common way to fetch data in React apps today is to use an effect:
-
-```js
-// In a function component:
-useEffect(() => {
- fetchSomething();
-}, []);
-
-// Or, in a class component:
-componentDidMount() {
- fetchSomething();
-}
-```
-
-We call this approach "fetch-on-render" because it doesn't start fetching until *after* the component has rendered on the screen. This leads to a problem known as a "waterfall".
-
-Consider these `` and `` components:
-
-```js{4-6,22-24}
-function ProfilePage() {
- const [user, setUser] = useState(null);
-
- useEffect(() => {
- fetchUser().then(u => setUser(u));
- }, []);
-
- if (user === null) {
- return
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/fragrant-glade-8huj6)**
-
-If you run this code and watch the console logs, you'll notice the sequence is:
-
-1. We start fetching user details
-2. We wait...
-3. We finish fetching user details
-4. We start fetching posts
-5. We wait...
-6. We finish fetching posts
-
-If fetching user details takes three seconds, we'll only *start* fetching the posts after three seconds! That's a "waterfall": an unintentional *sequence* that should have been parallelized.
-
-Waterfalls are common in code that fetches data on render. They're possible to solve, but as the product grows, many people prefer to use a solution that guards against this problem.
-
-### Approach 2: Fetch-Then-Render (not using Suspense) {#approach-2-fetch-then-render-not-using-suspense}
-
-Libraries can prevent waterfalls by offering a more centralized way to do data fetching. For example, Relay solves this problem by moving the information about the data a component needs to statically analyzable *fragments*, which later get composed into a single query.
-
-On this page, we don't assume knowledge of Relay, so we won't be using it for this example. Instead, we'll write something similar manually by combining our data fetching methods:
-
-```js
-function fetchProfileData() {
- return Promise.all([
- fetchUser(),
- fetchPosts()
- ]).then(([user, posts]) => {
- return {user, posts};
- })
-}
-```
-
-In this example, `` waits for both requests but starts them in parallel:
-
-```js{1,2,8-13}
-// Kick off fetching as early as possible
-const promise = fetchProfileData();
-
-function ProfilePage() {
- const [user, setUser] = useState(null);
- const [posts, setPosts] = useState(null);
-
- useEffect(() => {
- promise.then(data => {
- setUser(data.user);
- setPosts(data.posts);
- });
- }, []);
-
- if (user === null) {
- return
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/wandering-morning-ev6r0)**
-
-The event sequence now becomes like this:
-
-1. We start fetching user details
-2. We start fetching posts
-3. We wait...
-4. We finish fetching user details
-5. We finish fetching posts
-
-We've solved the previous network "waterfall", but accidentally introduced a different one. We wait for *all* data to come back with `Promise.all()` inside `fetchProfileData`, so now we can't render profile details until the posts have been fetched too. We have to wait for both.
-
-Of course, this is possible to fix in this particular example. We could remove the `Promise.all()` call, and wait for both Promises separately. However, this approach gets progressively more difficult as the complexity of our data and component tree grows. It's hard to write reliable components when arbitrary parts of the data tree may be missing or stale. So fetching all data for the new screen and *then* rendering is often a more practical option.
-
-### Approach 3: Render-as-You-Fetch (using Suspense) {#approach-3-render-as-you-fetch-using-suspense}
-
-In the previous approach, we fetched data before we called `setState`:
-
-1. Start fetching
-2. Finish fetching
-3. Start rendering
-
-With Suspense, we still start fetching first, but we flip the last two steps around:
-
-1. Start fetching
-2. **Start rendering**
-3. **Finish fetching**
-
-**With Suspense, we don't wait for the response to come back before we start rendering.** In fact, we start rendering *pretty much immediately* after kicking off the network request:
-
-```js{2,17,23}
-// This is not a Promise. It's a special object from our Suspense integration.
-const resource = fetchProfileData();
-
-function ProfilePage() {
- return (
- Loading profile...}>
-
- Loading posts...}>
-
-
-
- );
-}
-
-function ProfileDetails() {
- // Try to read user info, although it might not have loaded yet
- const user = resource.user.read();
- return
{user.name}
;
-}
-
-function ProfileTimeline() {
- // Try to read posts, although they might not have loaded yet
- const posts = resource.posts.read();
- return (
-
- {posts.map(post => (
-
{post.text}
- ))}
-
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/frosty-hermann-bztrp)**
-
-Here's what happens when we render `` on the screen:
-
-1. We've already kicked off the requests in `fetchProfileData()`. It gave us a special "resource" instead of a Promise. In a realistic example, it would be provided by our data library's Suspense integration, like Relay.
-2. React tries to render ``. It returns `` and `` as children.
-3. React tries to render ``. It calls `resource.user.read()`. None of the data is fetched yet, so this component "suspends". React skips over it, and tries rendering other components in the tree.
-4. React tries to render ``. It calls `resource.posts.read()`. Again, there's no data yet, so this component also "suspends". React skips over it too, and tries rendering other components in the tree.
-5. There's nothing left to try rendering. Because `` suspended, React shows the closest `` fallback above it in the tree: `
Loading profile...
`. We're done for now.
-
-This `resource` object represents the data that isn't there yet, but might eventually get loaded. When we call `read()`, we either get the data, or the component "suspends".
-
-**As more data streams in, React will retry rendering, and each time it might be able to progress "deeper".** When `resource.user` is fetched, the `` component will render successfully and we'll no longer need the `
Loading profile...
` fallback. Eventually, we'll get all the data, and there will be no fallbacks on the screen.
-
-This has an interesting implication. Even if we use a GraphQL client that collects all data requirements in a single request, *streaming the response lets us show more content sooner*. Because we render-*as-we-fetch* (as opposed to *after* fetching), if `user` appears in the response earlier than `posts`, we'll be able to "unlock" the outer `` boundary before the response even finishes. We might have missed this earlier, but even the fetch-then-render solution contained a waterfall: between fetching and rendering. Suspense doesn't inherently suffer from this waterfall, and libraries like Relay take advantage of this.
-
-Note how we eliminated the `if (...)` "is loading" checks from our components. This doesn't only remove boilerplate code, but it also simplifies making quick design changes. For example, if we wanted profile details and posts to always "pop in" together, we could delete the `` boundary between them. Or we could make them independent from each other by giving each *its own* `` boundary. Suspense lets us change the granularity of our loading states and orchestrate their sequencing without invasive changes to our code.
-
-## Start Fetching Early {#start-fetching-early}
-
-If you're working on a data fetching library, there's a crucial aspect of Render-as-You-Fetch you don't want to miss. **We kick off fetching _before_ rendering.** Look at this code example closer:
-
-```js
-// Start fetching early!
-const resource = fetchProfileData();
-
-// ...
-
-function ProfileDetails() {
- // Try to read user info
- const user = resource.user.read();
- return
{user.name}
;
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/frosty-hermann-bztrp)**
-
-Note that the `read()` call in this example doesn't *start* fetching. It only tries to read the data that is **already being fetched**. This difference is crucial to creating fast applications with Suspense. We don't want to delay loading data until a component starts rendering. As a data fetching library author, you can enforce this by making it impossible to get a `resource` object without also starting a fetch. Every demo on this page using our "fake API" enforces this.
-
-You might object that fetching "at the top level" like in this example is impractical. What are we going to do if we navigate to another profile's page? We might want to fetch based on props. The answer to this is **we want to start fetching in the event handlers instead**. Here is a simplified example of navigating between user's pages:
-
-```js{1,2,10,11}
-// First fetch: as soon as possible
-const initialResource = fetchProfileData(0);
-
-function App() {
- const [resource, setResource] = useState(initialResource);
- return (
- <>
-
-
- >
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/infallible-feather-xjtbu)**
-
-With this approach, we can **fetch code and data in parallel**. When we navigate between pages, we don't need to wait for a page's code to load to start loading its data. We can start fetching both code and data at the same time (during the link click), delivering a much better user experience.
-
-This poses a question of how do we know *what* to fetch before rendering the next screen. There are several ways to solve this (for example, by integrating data fetching closer with your routing solution). If you work on a data fetching library, [Building Great User Experiences with Concurrent Mode and Suspense](/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense.html) presents a deep dive on how to accomplish this and why it's important.
-
-### We're Still Figuring This Out {#were-still-figuring-this-out}
-
-Suspense itself as a mechanism is flexible and doesn't have many constraints. Product code needs to be more constrained to ensure no waterfalls, but there are different ways to provide these guarantees. Some questions that we're currently exploring include:
-
-* Fetching early can be cumbersome to express. How do we make it easier to avoid waterfalls?
-* When we fetch data for a page, can the API encourage including data for instant transitions *from* it?
-* What is the lifetime of a response? Should caching be global or local? Who manages the cache?
-* Can Proxies help express lazy-loaded APIs without inserting `read()` calls everywhere?
-* What would the equivalent of composing GraphQL queries look like for arbitrary Suspense data?
-
-Relay has its own answers to some of these questions. There is certainly more than a single way to do it, and we're excited to see what new ideas the React community comes up with.
-
-## Suspense and Race Conditions {#suspense-and-race-conditions}
-
-Race conditions are bugs that happen due to incorrect assumptions about the order in which our code may run. Fetching data in the `useEffect` Hook or in class lifecycle methods like `componentDidUpdate` often leads to them. Suspense can help here, too — let's see how.
-
-To demonstrate the issue, we will add a top-level `` component that renders our `` with a button that lets us **switch between different profiles**:
-
-```js{9-11}
-function getNextId(id) {
- // ...
-}
-
-function App() {
- const [id, setId] = useState(0);
- return (
- <>
-
-
- >
- );
-}
-```
-
-Let's compare how different data fetching strategies deal with this requirement.
-
-### Race Conditions with `useEffect` {#race-conditions-with-useeffect}
-
-First, we'll try a version of our original "fetch in effect" example. We'll modify it to pass an `id` parameter from the `` props to `fetchUser(id)` and `fetchPosts(id)`:
-
-```js{1,5,6,14,19,23,24}
-function ProfilePage({ id }) {
- const [user, setUser] = useState(null);
-
- useEffect(() => {
- fetchUser(id).then(u => setUser(u));
- }, [id]);
-
- if (user === null) {
- return
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/nervous-glade-b5sel)**
-
-Note how we also changed the effect dependencies from `[]` to `[id]` — because we want the effect to re-run when the `id` changes. Otherwise, we wouldn't refetch new data.
-
-If we try this code, it might seem like it works at first. However, if we randomize the delay time in our "fake API" implementation and press the "Next" button fast enough, we'll see from the console logs that something is going very wrong. **Requests from the previous profiles may sometimes "come back" after we've already switched the profile to another ID -- and in that case they can overwrite the new state with a stale response for a different ID.**
-
-This problem is possible to fix (you could use the effect cleanup function to either ignore or cancel stale requests), but it's unintuitive and difficult to debug.
-
-### Race Conditions with `componentDidUpdate` {#race-conditions-with-componentdidupdate}
-
-One might think that this is a problem specific to `useEffect` or Hooks. Maybe if we port this code to classes or use convenient syntax like `async` / `await`, it will solve the problem?
-
-Let's try that:
-
-```js
-class ProfilePage extends React.Component {
- state = {
- user: null,
- };
- componentDidMount() {
- this.fetchData(this.props.id);
- }
- componentDidUpdate(prevProps) {
- if (prevProps.id !== this.props.id) {
- this.fetchData(this.props.id);
- }
- }
- async fetchData(id) {
- const user = await fetchUser(id);
- this.setState({ user });
- }
- render() {
- const { id } = this.props;
- const { user } = this.state;
- if (user === null) {
- return
- );
- }
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/trusting-clarke-8twuq)**
-
-This code is deceptively easy to read.
-
-Unfortunately, neither using a class nor the `async` / `await` syntax helped us solve this problem. This version suffers from exactly the same race conditions, for the same reasons.
-
-### The Problem {#the-problem}
-
-React components have their own "lifecycle". They may receive props or update state at any point in time. However, each asynchronous request *also* has its own "lifecycle". It starts when we kick it off, and finishes when we get a response. The difficulty we're experiencing is "synchronizing" several processes in time that affect each other. This is hard to think about.
-
-### Solving Race Conditions with Suspense {#solving-race-conditions-with-suspense}
-
-Let's rewrite this example again, but using Suspense only:
-
-```js
-const initialResource = fetchProfileData(0);
-
-function App() {
- const [resource, setResource] = useState(initialResource);
- return (
- <>
-
-
- >
- );
-}
-
-function ProfilePage({ resource }) {
- return (
- Loading profile...}>
-
- Loading posts...}>
-
-
-
- );
-}
-
-function ProfileDetails({ resource }) {
- const user = resource.user.read();
- return
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/infallible-feather-xjtbu)**
-
-In the previous Suspense example, we only had one `resource`, so we held it in a top-level variable. Now that we have multiple resources, we moved it to the ``'s component state:
-
-```js{4}
-const initialResource = fetchProfileData(0);
-
-function App() {
- const [resource, setResource] = useState(initialResource);
-```
-
-When we click "Next", the `` component kicks off a request for the next profile, and passes *that* object down to the `` component:
-
-```js{4,8}
- <>
-
-
- >
-```
-
-Again, notice that **we're not waiting for the response to set the state. It's the other way around: we set the state (and start rendering) immediately after kicking off a request**. As soon as we have more data, React "fills in" the content inside `` components.
-
-This code is very readable, but unlike the examples earlier, the Suspense version doesn't suffer from race conditions. You might be wondering why. The answer is that in the Suspense version, we don't have to think about *time* as much in our code. Our original code with race conditions needed to set the state *at the right moment later*, or otherwise it would be wrong. But with Suspense, we set the state *immediately* -- so it's harder to mess it up.
-
-## Handling Errors {#handling-errors}
-
-When we write code with Promises, we might use `catch()` to handle errors. How does this work with Suspense, given that we don't *wait* for Promises to start rendering?
-
-With Suspense, handling fetching errors works the same way as handling rendering errors -- you can render an [error boundary](/docs/error-boundaries.html) anywhere to "catch" errors in components below.
-
-First, we'll define an error boundary component to use across our project:
-
-```js
-// Error boundaries currently have to be classes.
-class ErrorBoundary extends React.Component {
- state = { hasError: false, error: null };
- static getDerivedStateFromError(error) {
- return {
- hasError: true,
- error
- };
- }
- render() {
- if (this.state.hasError) {
- return this.props.fallback;
- }
- return this.props.children;
- }
-}
-```
-
-And then we can put it anywhere in the tree to catch errors:
-
-```js{5,9}
-function ProfilePage() {
- return (
- Loading profile...}>
-
- Could not fetch posts.}>
- Loading posts...}>
-
-
-
-
- );
-}
-```
-
-**[Try it on CodeSandbox](https://codesandbox.io/s/adoring-goodall-8wbn7)**
-
-It would catch both rendering errors *and* errors from Suspense data fetching. We can have as many error boundaries as we like but it's best to [be intentional](https://aweary.dev/fault-tolerance-react/) about their placement.
-
-## Next Steps {#next-steps}
-
-We've now covered the basics of Suspense for Data Fetching! Importantly, we now better understand *why* Suspense works this way, and how it fits into the data fetching space.
-
-Suspense answers some questions, but it also poses new questions of its own:
-
-* If some component "suspends", does the app freeze? How to avoid this?
-* What if we want to show a spinner in a different place than "above" the component in a tree?
-* If we intentionally *want* to show an inconsistent UI for a small period of time, can we do that?
-* Instead of showing a spinner, can we add a visual effect like "greying out" the current screen?
-* Why does our [last Suspense example](https://codesandbox.io/s/infallible-feather-xjtbu) log a warning when clicking the "Next" button?
-
-To answer these questions, we will refer to the next section on [Concurrent UI Patterns](/docs/concurrent-mode-patterns.html).
diff --git a/content/docs/create-a-new-react-app.md b/content/docs/create-a-new-react-app.md
deleted file mode 100644
index 12afba206..000000000
--- a/content/docs/create-a-new-react-app.md
+++ /dev/null
@@ -1,94 +0,0 @@
----
-id: create-a-new-react-app
-title: Create a New React App
-permalink: docs/create-a-new-react-app.html
-redirect_from:
- - "docs/add-react-to-a-new-app.html"
-prev: add-react-to-a-website.html
-next: cdn-links.html
----
-
-Use an integrated toolchain for the best user and developer experience.
-
-This page describes a few popular React toolchains which help with tasks like:
-
-* Scaling to many files and components.
-* Using third-party libraries from npm.
-* Detecting common mistakes early.
-* Live-editing CSS and JS in development.
-* Optimizing the output for production.
-
-The toolchains recommended on this page **don't require configuration to get started**.
-
-## You Might Not Need a Toolchain {#you-might-not-need-a-toolchain}
-
-If you don't experience the problems described above or don't feel comfortable using JavaScript tools yet, consider [adding React as a plain `
-```
-
-Also ensure the CDN responds with the `Access-Control-Allow-Origin: *` HTTP header:
-
-
-
-### Webpack {#webpack}
-
-#### Source maps {#source-maps}
-
-Some JavaScript bundlers may wrap the application code with `eval` statements in development. (For example Webpack will do this if [`devtool`](https://webpack.js.org/configuration/devtool/) is set to any value containing the word "eval".) This may cause errors to be treated as cross-origin.
-
-If you use Webpack, we recommend using the `cheap-module-source-map` setting in development to avoid this problem.
-
-#### Code splitting {#code-splitting}
-
-If your application is split into multiple bundles, these bundles may be loaded using JSONP. This may cause errors thrown in the code of these bundles to be treated as cross-origin.
-
-To resolve this, use the [`crossOriginLoading`](https://webpack.js.org/configuration/output/#output-crossoriginloading) setting in development to add the `crossorigin` attribute to the `
-
-Now that you have your component hierarchy, it's time to implement your app. The easiest way is to build a version that takes your data model and renders the UI but has no interactivity. It's best to decouple these processes because building a static version requires a lot of typing and no thinking, and adding interactivity requires a lot of thinking and not a lot of typing. We'll see why.
-
-To build a static version of your app that renders your data model, you'll want to build components that reuse other components and pass data using *props*. *props* are a way of passing data from parent to child. If you're familiar with the concept of *state*, **don't use state at all** to build this static version. State is reserved only for interactivity, that is, data that changes over time. Since this is a static version of the app, you don't need it.
-
-You can build top-down or bottom-up. That is, you can either start with building the components higher up in the hierarchy (i.e. starting with `FilterableProductTable`) or with the ones lower in it (`ProductRow`). In simpler examples, it's usually easier to go top-down, and on larger projects, it's easier to go bottom-up and write tests as you build.
-
-At the end of this step, you'll have a library of reusable components that render your data model. The components will only have `render()` methods since this is a static version of your app. The component at the top of the hierarchy (`FilterableProductTable`) will take your data model as a prop. If you make a change to your underlying data model and call `ReactDOM.render()` again, the UI will be updated. You can see how your UI is updated and where to make changes. React's **one-way data flow** (also called *one-way binding*) keeps everything modular and fast.
-
-Refer to the [React docs](/docs/) if you need help executing this step.
-
-### A Brief Interlude: Props vs State {#a-brief-interlude-props-vs-state}
-
-There are two types of "model" data in React: props and state. It's important to understand the distinction between the two; skim [the official React docs](/docs/state-and-lifecycle.html) if you aren't sure what the difference is. See also [FAQ: What is the difference between state and props?](/docs/faq-state.html#what-is-the-difference-between-state-and-props)
-
-## Step 3: Identify The Minimal (but complete) Representation Of UI State {#step-3-identify-the-minimal-but-complete-representation-of-ui-state}
-
-To make your UI interactive, you need to be able to trigger changes to your underlying data model. React achieves this with **state**.
-
-To build your app correctly, you first need to think of the minimal set of mutable state that your app needs. The key here is [DRY: *Don't Repeat Yourself*](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). Figure out the absolute minimal representation of the state your application needs and compute everything else you need on-demand. For example, if you're building a TODO list, keep an array of the TODO items around; don't keep a separate state variable for the count. Instead, when you want to render the TODO count, take the length of the TODO items array.
-
-Think of all the pieces of data in our example application. We have:
-
- * The original list of products
- * The search text the user has entered
- * The value of the checkbox
- * The filtered list of products
-
-Let's go through each one and figure out which one is state. Ask three questions about each piece of data:
-
- 1. Is it passed in from a parent via props? If so, it probably isn't state.
- 2. Does it remain unchanged over time? If so, it probably isn't state.
- 3. Can you compute it based on any other state or props in your component? If so, it isn't state.
-
-The original list of products is passed in as props, so that's not state. The search text and the checkbox seem to be state since they change over time and can't be computed from anything. And finally, the filtered list of products isn't state because it can be computed by combining the original list of products with the search text and value of the checkbox.
-
-So finally, our state is:
-
- * The search text the user has entered
- * The value of the checkbox
-
-## Step 4: Identify Where Your State Should Live {#step-4-identify-where-your-state-should-live}
-
-
-
-OK, so we've identified what the minimal set of app state is. Next, we need to identify which component mutates, or *owns*, this state.
-
-Remember: React is all about one-way data flow down the component hierarchy. It may not be immediately clear which component should own what state. **This is often the most challenging part for newcomers to understand,** so follow these steps to figure it out:
-
-For each piece of state in your application:
-
- * Identify every component that renders something based on that state.
- * Find a common owner component (a single component above all the components that need the state in the hierarchy).
- * Either the common owner or another component higher up in the hierarchy should own the state.
- * If you can't find a component where it makes sense to own the state, create a new component solely for holding the state and add it somewhere in the hierarchy above the common owner component.
-
-Let's run through this strategy for our application:
-
- * `ProductTable` needs to filter the product list based on state and `SearchBar` needs to display the search text and checked state.
- * The common owner component is `FilterableProductTable`.
- * It conceptually makes sense for the filter text and checked value to live in `FilterableProductTable`
-
-Cool, so we've decided that our state lives in `FilterableProductTable`. First, add an instance property `this.state = {filterText: '', inStockOnly: false}` to `FilterableProductTable`'s `constructor` to reflect the initial state of your application. Then, pass `filterText` and `inStockOnly` to `ProductTable` and `SearchBar` as a prop. Finally, use these props to filter the rows in `ProductTable` and set the values of the form fields in `SearchBar`.
-
-You can start seeing how your application will behave: set `filterText` to `"ball"` and refresh your app. You'll see that the data table is updated correctly.
-
-## Step 5: Add Inverse Data Flow {#step-5-add-inverse-data-flow}
-
-
-
-So far, we've built an app that renders correctly as a function of props and state flowing down the hierarchy. Now it's time to support data flowing the other way: the form components deep in the hierarchy need to update the state in `FilterableProductTable`.
-
-React makes this data flow explicit to help you understand how your program works, but it does require a little more typing than traditional two-way data binding.
-
-If you try to type or check the box in the current version of the example, you'll see that React ignores your input. This is intentional, as we've set the `value` prop of the `input` to always be equal to the `state` passed in from `FilterableProductTable`.
-
-Let's think about what we want to happen. We want to make sure that whenever the user changes the form, we update the state to reflect the user input. Since components should only update their own state, `FilterableProductTable` will pass callbacks to `SearchBar` that will fire whenever the state should be updated. We can use the `onChange` event on the inputs to be notified of it. The callbacks passed by `FilterableProductTable` will call `setState()`, and the app will be updated.
-
-## And That's It {#and-thats-it}
-
-Hopefully, this gives you an idea of how to think about building components and applications with React. While it may be a little more typing than you're used to, remember that code is read far more than it's written, and it's less difficult to read this modular, explicit code. As you start to build large libraries of components, you'll appreciate this explicitness and modularity, and with code reuse, your lines of code will start to shrink. :)
diff --git a/content/footerNav.yml b/content/footerNav.yml
deleted file mode 100644
index edd2c3313..000000000
--- a/content/footerNav.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-community:
- title: Community
-
-docs:
- title: Docs
-
-more:
- title: More
- items:
- - title: Tutorial
- to: /tutorial/tutorial.html
- - title: Blog
- to: /blog
- - title: Acknowledgements
- to: /acknowledgements.html
- - title: React Native
- to: https://reactnative.dev/
- external: true
-
-channels:
- title: Channels
- items:
- - title: GitHub
- to: https://github.com/facebook/react
- external: true
- - title: Stack Overflow
- to: https://stackoverflow.com/questions/tagged/reactjs
- external: true
- - title: Discussion Forums
- to: https://reactjs.org/community/support.html#popular-discussion-forums
- external: true
- - title: Reactiflux Chat
- to: https://discord.gg/reactiflux
- external: true
- - title: DEV Community
- to: https://dev.to/t/react
- external: true
- - title: Facebook
- to: https://www.facebook.com/react
- external: true
- - title: Twitter
- to: https://twitter.com/reactjs
- external: true
diff --git a/content/headerNav.yml b/content/headerNav.yml
deleted file mode 100644
index 325a95c48..000000000
--- a/content/headerNav.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-items:
- - title: Docs
- to: /docs/getting-started.html
- activeSelector: /docs/
- - title: Tutorial
- to: /tutorial/tutorial.html
- activeSelector: /tutorial
- - title: Blog
- to: /blog/
- activeSelector: /blog
- - title: Community
- to: /community/support.html
- activeSelector: /community
diff --git a/content/home/examples/a-component-using-external-plugins.js b/content/home/examples/a-component-using-external-plugins.js
deleted file mode 100644
index 305efe61c..000000000
--- a/content/home/examples/a-component-using-external-plugins.js
+++ /dev/null
@@ -1,42 +0,0 @@
-class MarkdownEditor extends React.Component {
- constructor(props) {
- super(props);
- this.md = new Remarkable();
- this.handleChange = this.handleChange.bind(this);
- this.state = { value: 'Hello, **world**!' };
- }
-
- handleChange(e) {
- this.setState({ value: e.target.value });
- }
-
- getRawMarkup() {
- return { __html: this.md.render(this.state.value) };
- }
-
- render() {
- return (
-
- );
- }
-}
-
-ReactDOM.render(
- ,
- document.getElementById('todos-example')
-);
diff --git a/content/images/blog/animal-sounds.jpg b/content/images/blog/animal-sounds.jpg
deleted file mode 100644
index abe6d815e..000000000
Binary files a/content/images/blog/animal-sounds.jpg and /dev/null differ
diff --git a/content/images/blog/chatapp.png b/content/images/blog/chatapp.png
deleted file mode 100644
index de8c09ff3..000000000
Binary files a/content/images/blog/chatapp.png and /dev/null differ
diff --git a/content/images/blog/cra-better-output.png b/content/images/blog/cra-better-output.png
deleted file mode 100644
index 44ed320ff..000000000
Binary files a/content/images/blog/cra-better-output.png and /dev/null differ
diff --git a/content/images/blog/cra-dynamic-import.gif b/content/images/blog/cra-dynamic-import.gif
deleted file mode 100644
index 88db2896f..000000000
Binary files a/content/images/blog/cra-dynamic-import.gif and /dev/null differ
diff --git a/content/images/blog/cra-jest-search.gif b/content/images/blog/cra-jest-search.gif
deleted file mode 100644
index ed6819d89..000000000
Binary files a/content/images/blog/cra-jest-search.gif and /dev/null differ
diff --git a/content/images/blog/cra-pwa.png b/content/images/blog/cra-pwa.png
deleted file mode 100644
index 9862ae565..000000000
Binary files a/content/images/blog/cra-pwa.png and /dev/null differ
diff --git a/content/images/blog/cra-runtime-error.gif b/content/images/blog/cra-runtime-error.gif
deleted file mode 100644
index 7b4405f62..000000000
Binary files a/content/images/blog/cra-runtime-error.gif and /dev/null differ
diff --git a/content/images/blog/cra-update-exports.gif b/content/images/blog/cra-update-exports.gif
deleted file mode 100644
index 2820d63df..000000000
Binary files a/content/images/blog/cra-update-exports.gif and /dev/null differ
diff --git a/content/images/blog/create-apps-with-no-configuration/compiled-successfully.png b/content/images/blog/create-apps-with-no-configuration/compiled-successfully.png
deleted file mode 100644
index 223f5abf2..000000000
Binary files a/content/images/blog/create-apps-with-no-configuration/compiled-successfully.png and /dev/null differ
diff --git a/content/images/blog/create-apps-with-no-configuration/compiled-with-warnings.png b/content/images/blog/create-apps-with-no-configuration/compiled-with-warnings.png
deleted file mode 100644
index 20aa25e3c..000000000
Binary files a/content/images/blog/create-apps-with-no-configuration/compiled-with-warnings.png and /dev/null differ
diff --git a/content/images/blog/create-apps-with-no-configuration/created-folder.png b/content/images/blog/create-apps-with-no-configuration/created-folder.png
deleted file mode 100644
index 44aff6dcd..000000000
Binary files a/content/images/blog/create-apps-with-no-configuration/created-folder.png and /dev/null differ
diff --git a/content/images/blog/create-apps-with-no-configuration/failed-to-compile.png b/content/images/blog/create-apps-with-no-configuration/failed-to-compile.png
deleted file mode 100644
index a72b5fb2e..000000000
Binary files a/content/images/blog/create-apps-with-no-configuration/failed-to-compile.png and /dev/null differ
diff --git a/content/images/blog/create-apps-with-no-configuration/npm-run-build.png b/content/images/blog/create-apps-with-no-configuration/npm-run-build.png
deleted file mode 100644
index a7b931e12..000000000
Binary files a/content/images/blog/create-apps-with-no-configuration/npm-run-build.png and /dev/null differ
diff --git a/content/images/blog/devtools-component-filters.gif b/content/images/blog/devtools-component-filters.gif
deleted file mode 100644
index 287c66757..000000000
Binary files a/content/images/blog/devtools-component-filters.gif and /dev/null differ
diff --git a/content/images/blog/devtools-full.gif b/content/images/blog/devtools-full.gif
deleted file mode 100644
index fd7ed9493..000000000
Binary files a/content/images/blog/devtools-full.gif and /dev/null differ
diff --git a/content/images/blog/devtools-highlight-updates.png b/content/images/blog/devtools-highlight-updates.png
deleted file mode 100644
index 780bcf2ef..000000000
Binary files a/content/images/blog/devtools-highlight-updates.png and /dev/null differ
diff --git a/content/images/blog/devtools-search.gif b/content/images/blog/devtools-search.gif
deleted file mode 100644
index 22d80051d..000000000
Binary files a/content/images/blog/devtools-search.gif and /dev/null differ
diff --git a/content/images/blog/devtools-side-pane.gif b/content/images/blog/devtools-side-pane.gif
deleted file mode 100644
index 381e3554e..000000000
Binary files a/content/images/blog/devtools-side-pane.gif and /dev/null differ
diff --git a/content/images/blog/devtools-tree-view.png b/content/images/blog/devtools-tree-view.png
deleted file mode 100644
index 854a39f8f..000000000
Binary files a/content/images/blog/devtools-tree-view.png and /dev/null differ
diff --git a/content/images/blog/devtools-v4-screenshot.png b/content/images/blog/devtools-v4-screenshot.png
deleted file mode 100644
index 83a67d548..000000000
Binary files a/content/images/blog/devtools-v4-screenshot.png and /dev/null differ
diff --git a/content/images/blog/dog-tutorial.png b/content/images/blog/dog-tutorial.png
deleted file mode 100644
index 72f8b4341..000000000
Binary files a/content/images/blog/dog-tutorial.png and /dev/null differ
diff --git a/content/images/blog/first-look.png b/content/images/blog/first-look.png
deleted file mode 100644
index d36aa1f35..000000000
Binary files a/content/images/blog/first-look.png and /dev/null differ
diff --git a/content/images/blog/flux-chart.png b/content/images/blog/flux-chart.png
deleted file mode 100644
index fbfdf94ea..000000000
Binary files a/content/images/blog/flux-chart.png and /dev/null differ
diff --git a/content/images/blog/flux-diagram.png b/content/images/blog/flux-diagram.png
deleted file mode 100644
index 69cf64e0b..000000000
Binary files a/content/images/blog/flux-diagram.png and /dev/null differ
diff --git a/content/images/blog/genesis_skeleton.png b/content/images/blog/genesis_skeleton.png
deleted file mode 100644
index 4b7c51e29..000000000
Binary files a/content/images/blog/genesis_skeleton.png and /dev/null differ
diff --git a/content/images/blog/gpu-cursor-move.gif b/content/images/blog/gpu-cursor-move.gif
deleted file mode 100644
index b3a621f78..000000000
Binary files a/content/images/blog/gpu-cursor-move.gif and /dev/null differ
diff --git a/content/images/blog/guess_filter.jpg b/content/images/blog/guess_filter.jpg
deleted file mode 100644
index 1983df1c8..000000000
Binary files a/content/images/blog/guess_filter.jpg and /dev/null differ
diff --git a/content/images/blog/hacker-news-react-native.png b/content/images/blog/hacker-news-react-native.png
deleted file mode 100644
index a65679aba..000000000
Binary files a/content/images/blog/hacker-news-react-native.png and /dev/null differ
diff --git a/content/images/blog/highlight-updates-example.gif b/content/images/blog/highlight-updates-example.gif
deleted file mode 100644
index ab0c87d0c..000000000
Binary files a/content/images/blog/highlight-updates-example.gif and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/commit-selector.png b/content/images/blog/introducing-the-react-profiler/commit-selector.png
deleted file mode 100644
index 9c027444d..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/commit-selector.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/component-chart.png b/content/images/blog/introducing-the-react-profiler/component-chart.png
deleted file mode 100644
index 3a3615db2..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/component-chart.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/devtools-profiler-tab.png b/content/images/blog/introducing-the-react-profiler/devtools-profiler-tab.png
deleted file mode 100644
index eabb3e500..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/devtools-profiler-tab.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/filtering-commits.gif b/content/images/blog/introducing-the-react-profiler/filtering-commits.gif
deleted file mode 100644
index 1d73258e3..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/filtering-commits.gif and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/flame-chart.png b/content/images/blog/introducing-the-react-profiler/flame-chart.png
deleted file mode 100644
index 80840b55c..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/flame-chart.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/interactions-for-commit.png b/content/images/blog/introducing-the-react-profiler/interactions-for-commit.png
deleted file mode 100644
index 8f1a14c61..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/interactions-for-commit.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/interactions.png b/content/images/blog/introducing-the-react-profiler/interactions.png
deleted file mode 100644
index 5683ac94a..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/interactions.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/navigate-between-interactions-and-commits.gif b/content/images/blog/introducing-the-react-profiler/navigate-between-interactions-and-commits.gif
deleted file mode 100644
index e500459c3..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/navigate-between-interactions-and-commits.gif and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/no-interactions.png b/content/images/blog/introducing-the-react-profiler/no-interactions.png
deleted file mode 100644
index d70199fc7..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/no-interactions.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/no-profiler-data-multi-root.png b/content/images/blog/introducing-the-react-profiler/no-profiler-data-multi-root.png
deleted file mode 100644
index e56fd4128..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/no-profiler-data-multi-root.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/no-render-times-for-selected-component.png b/content/images/blog/introducing-the-react-profiler/no-render-times-for-selected-component.png
deleted file mode 100644
index f77b42f85..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/no-render-times-for-selected-component.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/no-timing-data-for-commit.png b/content/images/blog/introducing-the-react-profiler/no-timing-data-for-commit.png
deleted file mode 100644
index 84a4dcac2..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/no-timing-data-for-commit.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/props-and-state.gif b/content/images/blog/introducing-the-react-profiler/props-and-state.gif
deleted file mode 100644
index b0b05b127..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/props-and-state.gif and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/ranked-chart.png b/content/images/blog/introducing-the-react-profiler/ranked-chart.png
deleted file mode 100644
index 01246f5e5..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/ranked-chart.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/see-all-commits-for-a-fiber.gif b/content/images/blog/introducing-the-react-profiler/see-all-commits-for-a-fiber.gif
deleted file mode 100644
index dac21e249..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/see-all-commits-for-a-fiber.gif and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/see-which-props-changed.gif b/content/images/blog/introducing-the-react-profiler/see-which-props-changed.gif
deleted file mode 100644
index ae965be9b..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/see-which-props-changed.gif and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/select-a-root-to-view-profiling-data.gif b/content/images/blog/introducing-the-react-profiler/select-a-root-to-view-profiling-data.gif
deleted file mode 100644
index b53f31025..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/select-a-root-to-view-profiling-data.gif and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/start-profiling.png b/content/images/blog/introducing-the-react-profiler/start-profiling.png
deleted file mode 100644
index 7256474c0..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/start-profiling.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/stop-profiling.png b/content/images/blog/introducing-the-react-profiler/stop-profiling.png
deleted file mode 100644
index 4ef27f333..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/stop-profiling.png and /dev/null differ
diff --git a/content/images/blog/introducing-the-react-profiler/zoom-in-and-out.gif b/content/images/blog/introducing-the-react-profiler/zoom-in-and-out.gif
deleted file mode 100644
index 3a8be2c9b..000000000
Binary files a/content/images/blog/introducing-the-react-profiler/zoom-in-and-out.gif and /dev/null differ
diff --git a/content/images/blog/jsx-compiler.png b/content/images/blog/jsx-compiler.png
deleted file mode 100644
index 9b5e169c0..000000000
Binary files a/content/images/blog/jsx-compiler.png and /dev/null differ
diff --git a/content/images/blog/kendoui.png b/content/images/blog/kendoui.png
deleted file mode 100644
index 8b18bf438..000000000
Binary files a/content/images/blog/kendoui.png and /dev/null differ
diff --git a/content/images/blog/khan-academy-editor.png b/content/images/blog/khan-academy-editor.png
deleted file mode 100644
index f0413939d..000000000
Binary files a/content/images/blog/khan-academy-editor.png and /dev/null differ
diff --git a/content/images/blog/landoflisp.png b/content/images/blog/landoflisp.png
deleted file mode 100644
index 42bad2d4b..000000000
Binary files a/content/images/blog/landoflisp.png and /dev/null differ
diff --git a/content/images/blog/lights-out.png b/content/images/blog/lights-out.png
deleted file mode 100644
index 78c545e7e..000000000
Binary files a/content/images/blog/lights-out.png and /dev/null differ
diff --git a/content/images/blog/makona-editor.png b/content/images/blog/makona-editor.png
deleted file mode 100644
index 4fc4ece99..000000000
Binary files a/content/images/blog/makona-editor.png and /dev/null differ
diff --git a/content/images/blog/markdown_refactor.png b/content/images/blog/markdown_refactor.png
deleted file mode 100644
index b81679541..000000000
Binary files a/content/images/blog/markdown_refactor.png and /dev/null differ
diff --git a/content/images/blog/modus-create.gif b/content/images/blog/modus-create.gif
deleted file mode 100644
index 194252ad1..000000000
Binary files a/content/images/blog/modus-create.gif and /dev/null differ
diff --git a/content/images/blog/monkeys.gif b/content/images/blog/monkeys.gif
deleted file mode 100644
index 3da6185ce..000000000
Binary files a/content/images/blog/monkeys.gif and /dev/null differ
diff --git a/content/images/blog/ngreact.png b/content/images/blog/ngreact.png
deleted file mode 100644
index 6ce7e3418..000000000
Binary files a/content/images/blog/ngreact.png and /dev/null differ
diff --git a/content/images/blog/om-backbone.png b/content/images/blog/om-backbone.png
deleted file mode 100644
index df411b280..000000000
Binary files a/content/images/blog/om-backbone.png and /dev/null differ
diff --git a/content/images/blog/parse-react.jpg b/content/images/blog/parse-react.jpg
deleted file mode 100644
index 15e45d2ae..000000000
Binary files a/content/images/blog/parse-react.jpg and /dev/null differ
diff --git a/content/images/blog/polarr.jpg b/content/images/blog/polarr.jpg
deleted file mode 100644
index 1cfb3cc90..000000000
Binary files a/content/images/blog/polarr.jpg and /dev/null differ
diff --git a/content/images/blog/propeller-logo.png b/content/images/blog/propeller-logo.png
deleted file mode 100644
index 81cfaa181..000000000
Binary files a/content/images/blog/propeller-logo.png and /dev/null differ
diff --git a/content/images/blog/property-finder.png b/content/images/blog/property-finder.png
deleted file mode 100644
index 709448b4f..000000000
Binary files a/content/images/blog/property-finder.png and /dev/null differ
diff --git a/content/images/blog/quiztime.png b/content/images/blog/quiztime.png
deleted file mode 100644
index 7021036e6..000000000
Binary files a/content/images/blog/quiztime.png and /dev/null differ
diff --git a/content/images/blog/react-50k-mock-full.jpg b/content/images/blog/react-50k-mock-full.jpg
deleted file mode 100644
index 1ebac0063..000000000
Binary files a/content/images/blog/react-50k-mock-full.jpg and /dev/null differ
diff --git a/content/images/blog/react-50k-mock.jpg b/content/images/blog/react-50k-mock.jpg
deleted file mode 100644
index bc2de61d4..000000000
Binary files a/content/images/blog/react-50k-mock.jpg and /dev/null differ
diff --git a/content/images/blog/react-50k-tshirt.jpg b/content/images/blog/react-50k-tshirt.jpg
deleted file mode 100644
index c96b44ca5..000000000
Binary files a/content/images/blog/react-50k-tshirt.jpg and /dev/null differ
diff --git a/content/images/blog/react-browserify-gulp.jpg b/content/images/blog/react-browserify-gulp.jpg
deleted file mode 100644
index d4389d6e9..000000000
Binary files a/content/images/blog/react-browserify-gulp.jpg and /dev/null differ
diff --git a/content/images/blog/react-dev-tools.jpg b/content/images/blog/react-dev-tools.jpg
deleted file mode 100644
index 7eef44629..000000000
Binary files a/content/images/blog/react-dev-tools.jpg and /dev/null differ
diff --git a/content/images/blog/react-diff-tree.png b/content/images/blog/react-diff-tree.png
deleted file mode 100644
index 9935e4ae1..000000000
Binary files a/content/images/blog/react-diff-tree.png and /dev/null differ
diff --git a/content/images/blog/react-draggable.png b/content/images/blog/react-draggable.png
deleted file mode 100644
index c0cb61f16..000000000
Binary files a/content/images/blog/react-draggable.png and /dev/null differ
diff --git a/content/images/blog/react-hackathon.jpg b/content/images/blog/react-hackathon.jpg
deleted file mode 100644
index 2537d9865..000000000
Binary files a/content/images/blog/react-hackathon.jpg and /dev/null differ
diff --git a/content/images/blog/react-page.png b/content/images/blog/react-page.png
deleted file mode 100644
index 3249fb370..000000000
Binary files a/content/images/blog/react-page.png and /dev/null differ
diff --git a/content/images/blog/react-perf-chrome-timeline.png b/content/images/blog/react-perf-chrome-timeline.png
deleted file mode 100644
index e9db8acfb..000000000
Binary files a/content/images/blog/react-perf-chrome-timeline.png and /dev/null differ
diff --git a/content/images/blog/react-php.png b/content/images/blog/react-php.png
deleted file mode 100644
index cb7e69abc..000000000
Binary files a/content/images/blog/react-php.png and /dev/null differ
diff --git a/content/images/blog/react-svg-fbp.png b/content/images/blog/react-svg-fbp.png
deleted file mode 100644
index ef89babad..000000000
Binary files a/content/images/blog/react-svg-fbp.png and /dev/null differ
diff --git a/content/images/blog/react-v16.13.0/hydration-warning-after.png b/content/images/blog/react-v16.13.0/hydration-warning-after.png
deleted file mode 100644
index 92b6c9919..000000000
Binary files a/content/images/blog/react-v16.13.0/hydration-warning-after.png and /dev/null differ
diff --git a/content/images/blog/react-v16.13.0/hydration-warning-before.png b/content/images/blog/react-v16.13.0/hydration-warning-before.png
deleted file mode 100644
index 381ab8677..000000000
Binary files a/content/images/blog/react-v16.13.0/hydration-warning-before.png and /dev/null differ
diff --git a/content/images/blog/react-v16.9.0/codemod.gif b/content/images/blog/react-v16.9.0/codemod.gif
deleted file mode 100644
index 955b30fdc..000000000
Binary files a/content/images/blog/react-v16.9.0/codemod.gif and /dev/null differ
diff --git a/content/images/blog/react-v16.9.0/cwm-warning.png b/content/images/blog/react-v16.9.0/cwm-warning.png
deleted file mode 100644
index 3ee69d748..000000000
Binary files a/content/images/blog/react-v16.9.0/cwm-warning.png and /dev/null differ
diff --git a/content/images/blog/react-v17-rc/react_17_delegation.png b/content/images/blog/react-v17-rc/react_17_delegation.png
deleted file mode 100644
index c8b23c0d6..000000000
Binary files a/content/images/blog/react-v17-rc/react_17_delegation.png and /dev/null differ
diff --git a/content/images/blog/reactive-bookmarklet.png b/content/images/blog/reactive-bookmarklet.png
deleted file mode 100644
index 25351e717..000000000
Binary files a/content/images/blog/reactive-bookmarklet.png and /dev/null differ
diff --git a/content/images/blog/reflux-flux.png b/content/images/blog/reflux-flux.png
deleted file mode 100644
index dad38c7d1..000000000
Binary files a/content/images/blog/reflux-flux.png and /dev/null differ
diff --git a/content/images/blog/relay-components/relay-architecture.png b/content/images/blog/relay-components/relay-architecture.png
deleted file mode 100644
index 0cfbff0d8..000000000
Binary files a/content/images/blog/relay-components/relay-architecture.png and /dev/null differ
diff --git a/content/images/blog/relay-components/relay-containers-data-flow.png b/content/images/blog/relay-components/relay-containers-data-flow.png
deleted file mode 100644
index 2f062dd65..000000000
Binary files a/content/images/blog/relay-components/relay-containers-data-flow.png and /dev/null differ
diff --git a/content/images/blog/relay-components/relay-containers.png b/content/images/blog/relay-components/relay-containers.png
deleted file mode 100644
index be7dee719..000000000
Binary files a/content/images/blog/relay-components/relay-containers.png and /dev/null differ
diff --git a/content/images/blog/relay-components/sample-newsfeed.png b/content/images/blog/relay-components/sample-newsfeed.png
deleted file mode 100644
index 0e7f5b5de..000000000
Binary files a/content/images/blog/relay-components/sample-newsfeed.png and /dev/null differ
diff --git a/content/images/blog/relay-visual-architecture-tour.png b/content/images/blog/relay-visual-architecture-tour.png
deleted file mode 100644
index b35c4978f..000000000
Binary files a/content/images/blog/relay-visual-architecture-tour.png and /dev/null differ
diff --git a/content/images/blog/release-script-build-confirmation.png b/content/images/blog/release-script-build-confirmation.png
deleted file mode 100644
index 02026d172..000000000
Binary files a/content/images/blog/release-script-build-confirmation.png and /dev/null differ
diff --git a/content/images/blog/release-script-build-overview.png b/content/images/blog/release-script-build-overview.png
deleted file mode 100644
index d726be464..000000000
Binary files a/content/images/blog/release-script-build-overview.png and /dev/null differ
diff --git a/content/images/blog/release-script-publish-confirmation.png b/content/images/blog/release-script-publish-confirmation.png
deleted file mode 100644
index e05e64830..000000000
Binary files a/content/images/blog/release-script-publish-confirmation.png and /dev/null differ
diff --git a/content/images/blog/resistance-calculator.png b/content/images/blog/resistance-calculator.png
deleted file mode 100644
index 16e8b3536..000000000
Binary files a/content/images/blog/resistance-calculator.png and /dev/null differ
diff --git a/content/images/blog/skills-matter.png b/content/images/blog/skills-matter.png
deleted file mode 100644
index 4a4858c3d..000000000
Binary files a/content/images/blog/skills-matter.png and /dev/null differ
diff --git a/content/images/blog/snake.png b/content/images/blog/snake.png
deleted file mode 100644
index 96d72b38a..000000000
Binary files a/content/images/blog/snake.png and /dev/null differ
diff --git a/content/images/blog/steve_reverse.gif b/content/images/blog/steve_reverse.gif
deleted file mode 100644
index a442fbbd9..000000000
Binary files a/content/images/blog/steve_reverse.gif and /dev/null differ
diff --git a/content/images/blog/strict-mode-unsafe-lifecycles-warning.png b/content/images/blog/strict-mode-unsafe-lifecycles-warning.png
deleted file mode 100644
index fbdeccde6..000000000
Binary files a/content/images/blog/strict-mode-unsafe-lifecycles-warning.png and /dev/null differ
diff --git a/content/images/blog/sweet-jsx.png b/content/images/blog/sweet-jsx.png
deleted file mode 100644
index f20aeede4..000000000
Binary files a/content/images/blog/sweet-jsx.png and /dev/null differ
diff --git a/content/images/blog/tcomb-react-native.png b/content/images/blog/tcomb-react-native.png
deleted file mode 100644
index 98120c758..000000000
Binary files a/content/images/blog/tcomb-react-native.png and /dev/null differ
diff --git a/content/images/blog/thinking-in-react-components.png b/content/images/blog/thinking-in-react-components.png
deleted file mode 100644
index c71a86bcb..000000000
Binary files a/content/images/blog/thinking-in-react-components.png and /dev/null differ
diff --git a/content/images/blog/thinking-in-react-mock.png b/content/images/blog/thinking-in-react-mock.png
deleted file mode 100644
index 78bd00a4a..000000000
Binary files a/content/images/blog/thinking-in-react-mock.png and /dev/null differ
diff --git a/content/images/blog/todomvc.png b/content/images/blog/todomvc.png
deleted file mode 100644
index ee78eb1cd..000000000
Binary files a/content/images/blog/todomvc.png and /dev/null differ
diff --git a/content/images/blog/turboreact.png b/content/images/blog/turboreact.png
deleted file mode 100644
index e8ef8cd3a..000000000
Binary files a/content/images/blog/turboreact.png and /dev/null differ
diff --git a/content/images/blog/tutsplus.png b/content/images/blog/tutsplus.png
deleted file mode 100644
index 771653086..000000000
Binary files a/content/images/blog/tutsplus.png and /dev/null differ
diff --git a/content/images/blog/unite.png b/content/images/blog/unite.png
deleted file mode 100644
index ab45a5355..000000000
Binary files a/content/images/blog/unite.png and /dev/null differ
diff --git a/content/images/blog/versioning-1.png b/content/images/blog/versioning-1.png
deleted file mode 100644
index c13f98fd1..000000000
Binary files a/content/images/blog/versioning-1.png and /dev/null differ
diff --git a/content/images/blog/versioning-2.png b/content/images/blog/versioning-2.png
deleted file mode 100644
index 39de2a010..000000000
Binary files a/content/images/blog/versioning-2.png and /dev/null differ
diff --git a/content/images/blog/versioning-3.png b/content/images/blog/versioning-3.png
deleted file mode 100644
index 1824e89a9..000000000
Binary files a/content/images/blog/versioning-3.png and /dev/null differ
diff --git a/content/images/blog/versioning-4.png b/content/images/blog/versioning-4.png
deleted file mode 100644
index 13ba32e39..000000000
Binary files a/content/images/blog/versioning-4.png and /dev/null differ
diff --git a/content/images/blog/versioning-5.png b/content/images/blog/versioning-5.png
deleted file mode 100644
index 542a3926b..000000000
Binary files a/content/images/blog/versioning-5.png and /dev/null differ
diff --git a/content/images/blog/versioning-6.png b/content/images/blog/versioning-6.png
deleted file mode 100644
index e82bc7136..000000000
Binary files a/content/images/blog/versioning-6.png and /dev/null differ
diff --git a/content/images/blog/versioning-poll.png b/content/images/blog/versioning-poll.png
deleted file mode 100644
index 8b3e18d93..000000000
Binary files a/content/images/blog/versioning-poll.png and /dev/null differ
diff --git a/content/images/blog/warn-legacy-context-in-strict-mode.png b/content/images/blog/warn-legacy-context-in-strict-mode.png
deleted file mode 100644
index e061325ac..000000000
Binary files a/content/images/blog/warn-legacy-context-in-strict-mode.png and /dev/null differ
diff --git a/content/images/blog/weather.png b/content/images/blog/weather.png
deleted file mode 100644
index 90c5e6fea..000000000
Binary files a/content/images/blog/weather.png and /dev/null differ
diff --git a/content/images/blog/wolfenstein_react.png b/content/images/blog/wolfenstein_react.png
deleted file mode 100644
index 98241b864..000000000
Binary files a/content/images/blog/wolfenstein_react.png and /dev/null differ
diff --git a/content/images/blog/xoxo2013.png b/content/images/blog/xoxo2013.png
deleted file mode 100644
index d35989095..000000000
Binary files a/content/images/blog/xoxo2013.png and /dev/null differ
diff --git a/content/images/blog/xreact.png b/content/images/blog/xreact.png
deleted file mode 100644
index ba23489d5..000000000
Binary files a/content/images/blog/xreact.png and /dev/null differ
diff --git a/content/images/docs/blur-popover-close.gif b/content/images/docs/blur-popover-close.gif
deleted file mode 100644
index fefc6b8a4..000000000
Binary files a/content/images/docs/blur-popover-close.gif and /dev/null differ
diff --git a/content/images/docs/cdn-cors-header.png b/content/images/docs/cdn-cors-header.png
deleted file mode 100644
index 31b047cbd..000000000
Binary files a/content/images/docs/cdn-cors-header.png and /dev/null differ
diff --git a/content/images/docs/cm-steps-simple.png b/content/images/docs/cm-steps-simple.png
deleted file mode 100644
index e5683f9e6..000000000
Binary files a/content/images/docs/cm-steps-simple.png and /dev/null differ
diff --git a/content/images/docs/codewinds-004.png b/content/images/docs/codewinds-004.png
deleted file mode 100644
index 6c4bc997f..000000000
Binary files a/content/images/docs/codewinds-004.png and /dev/null differ
diff --git a/content/images/docs/devtools-dev.png b/content/images/docs/devtools-dev.png
deleted file mode 100644
index 5347b4b8d..000000000
Binary files a/content/images/docs/devtools-dev.png and /dev/null differ
diff --git a/content/images/docs/devtools-prod.png b/content/images/docs/devtools-prod.png
deleted file mode 100644
index 4e200fb48..000000000
Binary files a/content/images/docs/devtools-prod.png and /dev/null differ
diff --git a/content/images/docs/error-boundaries-stack-trace-line-numbers.png b/content/images/docs/error-boundaries-stack-trace-line-numbers.png
deleted file mode 100644
index db828905a..000000000
Binary files a/content/images/docs/error-boundaries-stack-trace-line-numbers.png and /dev/null differ
diff --git a/content/images/docs/error-boundaries-stack-trace.png b/content/images/docs/error-boundaries-stack-trace.png
deleted file mode 100644
index f0d49d903..000000000
Binary files a/content/images/docs/error-boundaries-stack-trace.png and /dev/null differ
diff --git a/content/images/docs/granular-dom-updates.gif b/content/images/docs/granular-dom-updates.gif
deleted file mode 100644
index 1651b0dae..000000000
Binary files a/content/images/docs/granular-dom-updates.gif and /dev/null differ
diff --git a/content/images/docs/implementation-notes-tree.png b/content/images/docs/implementation-notes-tree.png
deleted file mode 100644
index 923ef5d0d..000000000
Binary files a/content/images/docs/implementation-notes-tree.png and /dev/null differ
diff --git a/content/images/docs/javascript-jabber.png b/content/images/docs/javascript-jabber.png
deleted file mode 100644
index 57d63c41c..000000000
Binary files a/content/images/docs/javascript-jabber.png and /dev/null differ
diff --git a/content/images/docs/keyboard-focus.png b/content/images/docs/keyboard-focus.png
deleted file mode 100644
index 65a8dc300..000000000
Binary files a/content/images/docs/keyboard-focus.png and /dev/null differ
diff --git a/content/images/docs/outerclick-with-keyboard.gif b/content/images/docs/outerclick-with-keyboard.gif
deleted file mode 100644
index c82d299f8..000000000
Binary files a/content/images/docs/outerclick-with-keyboard.gif and /dev/null differ
diff --git a/content/images/docs/outerclick-with-mouse.gif b/content/images/docs/outerclick-with-mouse.gif
deleted file mode 100644
index e562e0324..000000000
Binary files a/content/images/docs/outerclick-with-mouse.gif and /dev/null differ
diff --git a/content/images/docs/perf-dom.png b/content/images/docs/perf-dom.png
deleted file mode 100644
index 9a843c6ca..000000000
Binary files a/content/images/docs/perf-dom.png and /dev/null differ
diff --git a/content/images/docs/perf-exclusive.png b/content/images/docs/perf-exclusive.png
deleted file mode 100644
index a8ad5003c..000000000
Binary files a/content/images/docs/perf-exclusive.png and /dev/null differ
diff --git a/content/images/docs/perf-inclusive.png b/content/images/docs/perf-inclusive.png
deleted file mode 100644
index e46b370aa..000000000
Binary files a/content/images/docs/perf-inclusive.png and /dev/null differ
diff --git a/content/images/docs/perf-wasted.png b/content/images/docs/perf-wasted.png
deleted file mode 100644
index c73131818..000000000
Binary files a/content/images/docs/perf-wasted.png and /dev/null differ
diff --git a/content/images/docs/react-devtools-state.gif b/content/images/docs/react-devtools-state.gif
deleted file mode 100644
index c9ff6cd35..000000000
Binary files a/content/images/docs/react-devtools-state.gif and /dev/null differ
diff --git a/content/images/docs/should-component-update.png b/content/images/docs/should-component-update.png
deleted file mode 100644
index 590af60b8..000000000
Binary files a/content/images/docs/should-component-update.png and /dev/null differ
diff --git a/content/images/docs/thinking-in-react-tagtree.png b/content/images/docs/thinking-in-react-tagtree.png
deleted file mode 100644
index 3d4db2d23..000000000
Binary files a/content/images/docs/thinking-in-react-tagtree.png and /dev/null differ
diff --git a/content/images/external.png b/content/images/external.png
deleted file mode 100644
index 748a27e44..000000000
Binary files a/content/images/external.png and /dev/null differ
diff --git a/content/images/external_2x.png b/content/images/external_2x.png
deleted file mode 100644
index 66230854d..000000000
Binary files a/content/images/external_2x.png and /dev/null differ
diff --git a/content/images/logo.svg b/content/images/logo.svg
deleted file mode 100644
index 1c047e594..000000000
--- a/content/images/logo.svg
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
diff --git a/content/images/logo_og.png b/content/images/logo_og.png
deleted file mode 100644
index 6a30e151a..000000000
Binary files a/content/images/logo_og.png and /dev/null differ
diff --git a/content/images/logo_small.png b/content/images/logo_small.png
deleted file mode 100644
index b5ff6be9a..000000000
Binary files a/content/images/logo_small.png and /dev/null differ
diff --git a/content/images/logo_small_2x.png b/content/images/logo_small_2x.png
deleted file mode 100644
index d72bc1ffe..000000000
Binary files a/content/images/logo_small_2x.png and /dev/null differ
diff --git a/content/images/logo_small_gray.png b/content/images/logo_small_gray.png
deleted file mode 100644
index 666fd5aa4..000000000
Binary files a/content/images/logo_small_gray.png and /dev/null differ
diff --git a/content/images/logo_small_gray_2x.png b/content/images/logo_small_gray_2x.png
deleted file mode 100644
index ccf4a455e..000000000
Binary files a/content/images/logo_small_gray_2x.png and /dev/null differ
diff --git a/content/images/noise.png b/content/images/noise.png
deleted file mode 100644
index 698f924f4..000000000
Binary files a/content/images/noise.png and /dev/null differ
diff --git a/content/images/oss_logo.png b/content/images/oss_logo.png
deleted file mode 100644
index 3f376bee9..000000000
Binary files a/content/images/oss_logo.png and /dev/null differ
diff --git a/content/images/search.png b/content/images/search.png
deleted file mode 100644
index 151377693..000000000
Binary files a/content/images/search.png and /dev/null differ
diff --git a/content/images/team/acdlite.jpg b/content/images/team/acdlite.jpg
deleted file mode 100644
index ab54b793b..000000000
Binary files a/content/images/team/acdlite.jpg and /dev/null differ
diff --git a/content/images/team/bvaughn.jpg b/content/images/team/bvaughn.jpg
deleted file mode 100644
index 227fe8d94..000000000
Binary files a/content/images/team/bvaughn.jpg and /dev/null differ
diff --git a/content/images/team/gaearon.jpg b/content/images/team/gaearon.jpg
deleted file mode 100644
index e152143b7..000000000
Binary files a/content/images/team/gaearon.jpg and /dev/null differ
diff --git a/content/images/team/lunaruan.jpg b/content/images/team/lunaruan.jpg
deleted file mode 100644
index 91daa3d17..000000000
Binary files a/content/images/team/lunaruan.jpg and /dev/null differ
diff --git a/content/images/team/necolas.jpg b/content/images/team/necolas.jpg
deleted file mode 100644
index b7caaac06..000000000
Binary files a/content/images/team/necolas.jpg and /dev/null differ
diff --git a/content/images/team/rickhanlonii.jpg b/content/images/team/rickhanlonii.jpg
deleted file mode 100644
index eb04614c5..000000000
Binary files a/content/images/team/rickhanlonii.jpg and /dev/null differ
diff --git a/content/images/team/rnabors.jpg b/content/images/team/rnabors.jpg
deleted file mode 100644
index 4425c90db..000000000
Binary files a/content/images/team/rnabors.jpg and /dev/null differ
diff --git a/content/images/team/sebmarkbage.jpg b/content/images/team/sebmarkbage.jpg
deleted file mode 100644
index 56a480ff4..000000000
Binary files a/content/images/team/sebmarkbage.jpg and /dev/null differ
diff --git a/content/images/team/sethwebster.jpg b/content/images/team/sethwebster.jpg
deleted file mode 100644
index c665a0b00..000000000
Binary files a/content/images/team/sethwebster.jpg and /dev/null differ
diff --git a/content/images/team/threepointone.jpg b/content/images/team/threepointone.jpg
deleted file mode 100644
index 9ad860171..000000000
Binary files a/content/images/team/threepointone.jpg and /dev/null differ
diff --git a/content/images/team/trueadm.jpg b/content/images/team/trueadm.jpg
deleted file mode 100644
index 33a6b838f..000000000
Binary files a/content/images/team/trueadm.jpg and /dev/null differ
diff --git a/content/images/tutorial/devtools.png b/content/images/tutorial/devtools.png
deleted file mode 100644
index 59cea8db6..000000000
Binary files a/content/images/tutorial/devtools.png and /dev/null differ
diff --git a/content/images/tutorial/tictac-empty.png b/content/images/tutorial/tictac-empty.png
deleted file mode 100644
index fabe3f034..000000000
Binary files a/content/images/tutorial/tictac-empty.png and /dev/null differ
diff --git a/content/images/tutorial/tictac-numbers.png b/content/images/tutorial/tictac-numbers.png
deleted file mode 100644
index 69d163f45..000000000
Binary files a/content/images/tutorial/tictac-numbers.png and /dev/null differ
diff --git a/content/languages.yml b/content/languages.yml
deleted file mode 100644
index 6f437c090..000000000
--- a/content/languages.yml
+++ /dev/null
@@ -1,197 +0,0 @@
-# Status enums indicate what percentage of "core" content has been translated:
-# 0: Incomplete (0-49%)
-# 1: Partially complete (50-99%)
-# 2: Complete (100%)
-
-- name: English
- translated_name: English
- code: en
- status: 2
-- name: Arabic
- translated_name: العربية
- code: ar
- status: 2
-- name: Azerbaijani
- translated_name: Azərbaycanca
- code: az
- status: 2
-- name: Bulgarian
- translated_name: Български
- code: bg
- status: 1
-- name: Bengali
- translated_name: বাংলা
- code: bn
- status: 1
-- name: Catalan
- translated_name: Català
- code: ca
- status: 1
-- name: German
- translated_name: Deutsch
- code: de
- status: 1
-- name: Greek
- translated_name: Ελληνικά
- code: el
- status: 1
-- name: Spanish
- translated_name: Español
- code: es
- status: 2
-- name: Persian
- translated_name: فارسی
- code: fa
- status: 1
-- name: French
- translated_name: Français
- code: fr
- status: 2
-- name: Gujarati
- translated_name: ગુજરાતી
- code: gu
- status: 0
-- name: Hebrew
- translated_name: עברית
- code: he
- status: 1
-- name: Hindi
- translated_name: हिन्दी
- code: hi
- status: 0
-- name: Haitian Creole
- translated_name: Kreyòl ayisyen
- code: ht
- status: 0
-- name: Hungarian
- translated_name: magyar
- code: hu
- status: 2
-- name: Armenian
- translated_name: Հայերեն
- code: hy
- status: 0
-- name: Indonesian
- translated_name: Bahasa Indonesia
- code: id
- status: 1
-- name: Italian
- translated_name: Italiano
- code: it
- status: 2
-- name: Japanese
- translated_name: 日本語
- code: ja
- status: 2
-- name: Georgian
- translated_name: ქართული
- code: ka
- status: 0
-- name: Central Khmer
- translated_name: ភាសាខ្មែរ
- code: km
- status: 0
-- name: Kannada
- translated_name: ಕನ್ನಡ
- code: kn
- status: 0
-- name: Korean
- translated_name: 한국어
- code: ko
- status: 2
-- name: Kurdish
- translated_name: کوردی
- code: ku
- status: 0
-- name: Lithuanian
- translated_name: Lietuvių kalba
- code: lt
- status: 0
-- name: Malayalam
- translated_name: മലയാളം
- code: ml
- status: 0
-- name: Mongolian
- translated_name: Монгол хэл
- code: mn
- status: 2
-- name: Nepali
- translated_name: नेपाली
- code: ne
- status: 0
-- name: Dutch
- translated_name: Nederlands
- code: nl
- status: 0
-- name: Polish
- translated_name: Polski
- code: pl
- status: 2
-- name: Portuguese (Brazil)
- translated_name: Português do Brasil
- code: pt-br
- status: 2
-- name: Portuguese (Portugal)
- translated_name: Português europeu
- code: pt-pt
- status: 0
-- name: Romanian
- translated_name: Română
- code: ro
- status: 0
-- name: Russian
- translated_name: Русский
- code: ru
- status: 2
-- name: Sinhala
- translated_name: සිංහල
- code: si
- status: 0
-- name: Swedish
- translated_name: Svenska
- code: sv
- status: 0
-- name: Tamil
- translated_name: தமிழ்
- code: ta
- status: 0
-- name: Telugu
- translated_name: తెలుగు
- code: te
- status: 0
-- name: Thai
- translated_name: ไทย
- code: th
- status: 0
-- name: Tagalog
- translated_name: Wikang Tagalog
- code: tl
- status: 0
-- name: Turkish
- translated_name: Türkçe
- code: tr
- status: 2
-- name: Ukrainian
- translated_name: Українська
- code: uk
- status: 2
-- name: Urdu
- translated_name: اردو
- code: ur
- status: 0
-- name: Uzbek
- translated_name: Oʻzbekcha
- code: uz
- status: 0
-- name: Vietnamese
- translated_name: Tiếng Việt
- code: vi
- status: 1
-- name: Simplified Chinese
- translated_name: 简体中文
- code: zh-hans
- status: 2
-- name: Traditional Chinese
- translated_name: 繁體中文
- code: zh-hant
- status: 2
diff --git a/content/versions.yml b/content/versions.yml
deleted file mode 100644
index 0ddf8a6e1..000000000
--- a/content/versions.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-- title: '17.0.2'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1702-march-22-2021
-- title: '17.0.1'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1701-october-22-2020
-- title: '17.0.0'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1700-october-20-2020
-- title: '16.14.0'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#16140-october-14-2020
-- title: '16.13.1'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#16131-march-19-2020
-- title: '16.13.0'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#16130-february-26-2020
-- title: '16.12.0'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#16120-november-14-2019
-- title: '16.11'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#16110-october-22-2019
-- title: '16.10.2'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#16102-october-3-2019
-- title: '16.10.1'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#16101-september-28-2019
-- title: '16.10'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#16100-september-27-2019
-- title: '16.9'
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1690-august-8-2019
-- title: '16.8'
- path: /version/16.8
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1680-february-6-2019
- url: https://5d4b5feba32acd0008d0df98--reactjs.netlify.com/
-- title: '16.7'
- path: /version/16.7
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1670-december-19-2018
- url: https://5c54aa429e16c80007af3cd2--reactjs.netlify.com/
-- title: '16.6'
- path: /version/16.6
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1660-october-23-2018
- url: https://5c11762d4be4d10008916ab1--reactjs.netlify.com/
-- title: '16.5'
- path: /version/16.5
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1650-september-5-2018
- url: https://5bcf5863c6aed64970d6de5b--reactjs.netlify.com/
-- title: '16.4'
- path: /version/16.4
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1640-may-23-2018
- url: https://5b90c17ac9659241e7f4c938--reactjs.netlify.com
-- title: '16.3'
- path: /version/16.3
- url: https://5b05c94e0733d530fd1fafe0--reactjs.netlify.com
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1632-april-16-2018
-- title: '16.2'
- path: /version/16.2
- url: https://5abc31d8be40f1556f06c4be--reactjs.netlify.com
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1620-november-28-2017
-- title: '16.1'
- path: /version/16.1
- url: https://5a1dbcf14c4b93299e65b9a9--reactjs.netlify.com
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1611-november-13-2017
-- title: '16.0'
- path: /version/16.0
- url: https://5a046bf5a6188f4b8fa4938a--reactjs.netlify.com
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1600-september-26-2017
-- title: '15.6'
- path: /version/15.6
- url: https://react-legacy.netlify.com
- changelog: https://github.com/facebook/react/blob/main/CHANGELOG.md#1562-september-25-2017
diff --git a/content/warnings/dont-call-proptypes.md b/content/warnings/dont-call-proptypes.md
deleted file mode 100644
index 07dfa33f0..000000000
--- a/content/warnings/dont-call-proptypes.md
+++ /dev/null
@@ -1,100 +0,0 @@
----
-title: Don't Call PropTypes Warning
-layout: single
-permalink: warnings/dont-call-proptypes.html
----
-
-> Note:
->
-> `React.PropTypes` has moved into a different package since React v15.5. Please use [the `prop-types` library instead](https://www.npmjs.com/package/prop-types).
->
->We provide [a codemod script](/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) to automate the conversion.
-
-In a future major release of React, the code that implements PropType validation functions will be stripped in production. Once this happens, any code that calls these functions manually (that isn't stripped in production) will throw an error.
-
-### Declaring PropTypes is still fine {#declaring-proptypes-is-still-fine}
-
-The normal usage of PropTypes is still supported:
-
-```javascript
-Button.propTypes = {
- highlighted: PropTypes.bool
-};
-```
-
-Nothing changes here.
-
-### Don’t call PropTypes directly {#dont-call-proptypes-directly}
-
-Using PropTypes in any other way than annotating React components with them is no longer supported:
-
-```javascript
-var apiShape = PropTypes.shape({
- body: PropTypes.object,
- statusCode: PropTypes.number.isRequired
-}).isRequired;
-
-// Not supported!
-var error = apiShape(json, 'response');
-```
-
-If you depend on using PropTypes like this, we encourage you to use or create a fork of PropTypes (such as [these](https://github.com/aackerman/PropTypes) [two](https://github.com/developit/proptypes) packages).
-
-If you don't fix the warning, this code will crash in production with React 16.
-
-### If you don't call PropTypes directly but still get the warning {#if-you-dont-call-proptypes-directly-but-still-get-the-warning}
-
-Inspect the stack trace produced by the warning. You will find the component definition responsible for the PropTypes direct call. Most likely, the issue is due to third-party PropTypes that wrap React’s PropTypes, for example:
-
-```js
-Button.propTypes = {
- highlighted: ThirdPartyPropTypes.deprecated(
- PropTypes.bool,
- 'Use `active` prop instead'
- )
-}
-```
-
-In this case, `ThirdPartyPropTypes.deprecated` is a wrapper calling `PropTypes.bool`. This pattern by itself is fine, but triggers a false positive because React thinks you are calling PropTypes directly. The next section explains how to fix this problem for a library implementing something like `ThirdPartyPropTypes`. If it's not a library you wrote, you can file an issue against it.
-
-### Fixing the false positive in third party PropTypes {#fixing-the-false-positive-in-third-party-proptypes}
-
-If you are an author of a third party PropTypes library and you let consumers wrap existing React PropTypes, they might start seeing this warning coming from your library. This happens because React doesn't see a "secret" last argument that [it passes](https://github.com/facebook/react/pull/7132) to detect manual PropTypes calls.
-
-Here is how to fix it. We will use `deprecated` from [react-bootstrap/react-prop-types](https://github.com/react-bootstrap/react-prop-types/blob/0d1cd3a49a93e513325e3258b28a82ce7d38e690/src/deprecated.js) as an example. The current implementation only passes down the `props`, `propName`, and `componentName` arguments:
-
-```javascript
-export default function deprecated(propType, explanation) {
- return function validate(props, propName, componentName) {
- if (props[propName] != null) {
- const message = `"${propName}" property of "${componentName}" has been deprecated.\n${explanation}`;
- if (!warned[message]) {
- warning(false, message);
- warned[message] = true;
- }
- }
-
- return propType(props, propName, componentName);
- };
-}
-```
-
-In order to fix the false positive, make sure you pass **all** arguments down to the wrapped PropType. This is easy to do with the ES6 `...rest` notation:
-
-```javascript
-export default function deprecated(propType, explanation) {
- return function validate(props, propName, componentName, ...rest) { // Note ...rest here
- if (props[propName] != null) {
- const message = `"${propName}" property of "${componentName}" has been deprecated.\n${explanation}`;
- if (!warned[message]) {
- warning(false, message);
- warned[message] = true;
- }
- }
-
- return propType(props, propName, componentName, ...rest); // and here
- };
-}
-```
-
-This will silence the warning.
diff --git a/content/warnings/invalid-aria-prop.md b/content/warnings/invalid-aria-prop.md
deleted file mode 100644
index 53ebdd9bc..000000000
--- a/content/warnings/invalid-aria-prop.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-title: Invalid ARIA Prop Warning
-layout: single
-permalink: warnings/invalid-aria-prop.html
----
-
-The invalid-aria-prop warning will fire if you attempt to render a DOM element with an aria-* prop that does not exist in the Web Accessibility Initiative (WAI) Accessible Rich Internet Application (ARIA) [specification](https://www.w3.org/TR/wai-aria-1.1/#states_and_properties).
-
-1. If you feel that you are using a valid prop, check the spelling carefully. `aria-labelledby` and `aria-activedescendant` are often misspelled.
-
-2. React does not yet recognize the attribute you specified. This will likely be fixed in a future version of React. However, React currently strips all unknown attributes, so specifying them in your React app will not cause them to be rendered
\ No newline at end of file
diff --git a/content/warnings/invalid-hook-call-warning.md b/content/warnings/invalid-hook-call-warning.md
deleted file mode 100644
index 156578ec2..000000000
--- a/content/warnings/invalid-hook-call-warning.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-title: Invalid Hook Call Warning
-layout: single
-permalink: warnings/invalid-hook-call-warning.html
----
-
- You are probably here because you got the following error message:
-
- > Hooks can only be called inside the body of a function component.
-
-There are three common reasons you might be seeing it:
-
-1. You might have **mismatching versions** of React and React DOM.
-2. You might be **breaking the [Rules of Hooks](/docs/hooks-rules.html)**.
-3. You might have **more than one copy of React** in the same app.
-
-Let's look at each of these cases.
-
-## Mismatching Versions of React and React DOM {#mismatching-versions-of-react-and-react-dom}
-
-You might be using a version of `react-dom` (< 16.8.0) or `react-native` (< 0.59) that doesn't yet support Hooks. You can run `npm ls react-dom` or `npm ls react-native` in your application folder to check which version you're using. If you find more than one of them, this might also create problems (more on that below).
-
-## Breaking the Rules of Hooks {#breaking-the-rules-of-hooks}
-
-You can only call Hooks **while React is rendering a function component**:
-
-* ✅ Call them at the top level in the body of a function component.
-* ✅ Call them at the top level in the body of a [custom Hook](/docs/hooks-custom.html).
-
-**Learn more about this in the [Rules of Hooks](/docs/hooks-rules.html).**
-
-```js{2-3,8-9}
-function Counter() {
- // ✅ Good: top-level in a function component
- const [count, setCount] = useState(0);
- // ...
-}
-
-function useWindowWidth() {
- // ✅ Good: top-level in a custom Hook
- const [width, setWidth] = useState(window.innerWidth);
- // ...
-}
-```
-
-To avoid confusion, it’s **not** supported to call Hooks in other cases:
-
-* 🔴 Do not call Hooks in class components.
-* 🔴 Do not call in event handlers.
-* 🔴 Do not call Hooks inside functions passed to `useMemo`, `useReducer`, or `useEffect`.
-
-If you break these rules, you might see this error.
-
-```js{3-4,11-12,20-21}
-function Bad1() {
- function handleClick() {
- // 🔴 Bad: inside an event handler (to fix, move it outside!)
- const theme = useContext(ThemeContext);
- }
- // ...
-}
-
-function Bad2() {
- const style = useMemo(() => {
- // 🔴 Bad: inside useMemo (to fix, move it outside!)
- const theme = useContext(ThemeContext);
- return createStyle(theme);
- });
- // ...
-}
-
-class Bad3 extends React.Component {
- render() {
- // 🔴 Bad: inside a class component
- useEffect(() => {})
- // ...
- }
-}
-```
-
-You can use the [`eslint-plugin-react-hooks` plugin](https://www.npmjs.com/package/eslint-plugin-react-hooks) to catch some of these mistakes.
-
->Note
->
->[Custom Hooks](/docs/hooks-custom.html) *may* call other Hooks (that's their whole purpose). This works because custom Hooks are also supposed to only be called while a function component is rendering.
-
-
-## Duplicate React {#duplicate-react}
-
-In order for Hooks to work, the `react` import from your application code needs to resolve to the same module as the `react` import from inside the `react-dom` package.
-
-If these `react` imports resolve to two different exports objects, you will see this warning. This may happen if you **accidentally end up with two copies** of the `react` package.
-
-If you use Node for package management, you can run this check in your project folder:
-
- npm ls react
-
-If you see more than one React, you'll need to figure out why this happens and fix your dependency tree. For example, maybe a library you're using incorrectly specifies `react` as a dependency (rather than a peer dependency). Until that library is fixed, [Yarn resolutions](https://yarnpkg.com/lang/en/docs/selective-version-resolutions/) is one possible workaround.
-
-You can also try to debug this problem by adding some logs and restarting your development server:
-
-```js
-// Add this in node_modules/react-dom/index.js
-window.React1 = require('react');
-
-// Add this in your component file
-require('react-dom');
-window.React2 = require('react');
-console.log(window.React1 === window.React2);
-```
-
-If it prints `false` then you might have two Reacts and need to figure out why that happened. [This issue](https://github.com/facebook/react/issues/13991) includes some common reasons encountered by the community.
-
-This problem can also come up when you use `npm link` or an equivalent. In that case, your bundler might "see" two Reacts — one in application folder and one in your library folder. Assuming `myapp` and `mylib` are sibling folders, one possible fix is to run `npm link ../myapp/node_modules/react` from `mylib`. This should make the library use the application's React copy.
-
->Note
->
->In general, React supports using multiple independent copies on one page (for example, if an app and a third-party widget both use it). It only breaks if `require('react')` resolves differently between the component and the `react-dom` copy it was rendered with.
-
-## Other Causes {#other-causes}
-
-If none of this worked, please comment in [this issue](https://github.com/facebook/react/issues/13991) and we'll try to help. Try to create a small reproducing example — you might discover the problem as you're doing it.
diff --git a/content/warnings/legacy-factories.md b/content/warnings/legacy-factories.md
deleted file mode 100644
index a99d22e2f..000000000
--- a/content/warnings/legacy-factories.md
+++ /dev/null
@@ -1,59 +0,0 @@
----
-title: React Element Factories and JSX Warning
-layout: single
-permalink: warnings/legacy-factories.html
----
-
-You probably came here because your code is calling your component as a plain function call. This is now deprecated:
-
-```javascript
-var MyComponent = require('MyComponent');
-
-function render() {
- return MyComponent({ foo: 'bar' }); // WARNING
-}
-```
-
-## JSX {#jsx}
-
-React components can no longer be called directly like this. Instead [you can use JSX](/docs/jsx-in-depth.html).
-
-```javascript
-var React = require('react');
-var MyComponent = require('MyComponent');
-
-function render() {
- return ;
-}
-```
-
-## Without JSX {#without-jsx}
-
-If you don't want to, or can't use JSX, then you'll need to wrap your component in a factory before calling it:
-
-```javascript
-var React = require('react');
-var MyComponent = React.createFactory(require('MyComponent'));
-
-function render() {
- return MyComponent({ foo: 'bar' });
-}
-```
-
-This is an easy upgrade path if you have a lot of existing function calls.
-
-## Dynamic components without JSX {#dynamic-components-without-jsx}
-
-If you get a component class from a dynamic source, then it might be unnecessary to create a factory that you immediately invoke. Instead you can just create your element inline:
-
-```javascript
-var React = require('react');
-
-function render(MyComponent) {
- return React.createElement(MyComponent, { foo: 'bar' });
-}
-```
-
-## In Depth {#in-depth}
-
-[Read more about WHY we're making this change.](https://gist.github.com/sebmarkbage/d7bce729f38730399d28)
diff --git a/content/warnings/refs-must-have-owner.md b/content/warnings/refs-must-have-owner.md
deleted file mode 100644
index 9eda89c4c..000000000
--- a/content/warnings/refs-must-have-owner.md
+++ /dev/null
@@ -1,63 +0,0 @@
----
-title: Refs Must Have Owner Warning
-layout: single
-permalink: warnings/refs-must-have-owner.html
----
-
-You are probably here because you got one of the following error messages:
-
-*React 16.0.0+*
-> Warning:
->
-> Element ref was specified as a string (myRefName) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).
-
-*earlier versions of React*
-> Warning:
->
-> addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded.
-
-This usually means one of three things:
-
-- You are trying to add a `ref` to a function component.
-- You are trying to add a `ref` to an element that is being created outside of a component's render() function.
-- You have multiple (conflicting) copies of React loaded (eg. due to a misconfigured npm dependency)
-
-## Refs on Function Components {#refs-on-function-components}
-
-If `` is a function component, you can't add a ref to it:
-
-```js
-// Doesn't work if Foo is a function!
-
-```
-
-If you need to add a ref to a component, convert it to a class first, or consider not using refs as they are [rarely necessary](/docs/refs-and-the-dom.html#when-to-use-refs).
-
-## Strings Refs Outside the Render Method {#strings-refs-outside-the-render-method}
-
-This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). For example, this won't work:
-
-```js
-// Doesn't work!
-ReactDOM.render(, el);
-```
-
-Try rendering this component inside of a new top-level component which will hold the ref. Alternatively, you may use a callback ref:
-
-```js
-let app;
-ReactDOM.render(
- {
- app = inst;
- }} />,
- el
-);
-```
-
-Consider if you [really need a ref](/docs/refs-and-the-dom.html#when-to-use-refs) before using this approach.
-
-## Multiple copies of React {#multiple-copies-of-react}
-
-Bower does a good job of deduplicating dependencies, but npm does not. If you aren't doing anything (fancy) with refs, there is a good chance that the problem is not with your refs, but rather an issue with having multiple copies of React loaded into your project. Sometimes, when you pull in a third-party module via npm, you will get a duplicate copy of the dependency library, and this can create problems.
-
-If you are using npm... `npm ls` or `npm ls react` might help illuminate.
diff --git a/content/warnings/special-props.md b/content/warnings/special-props.md
deleted file mode 100644
index 32857abf2..000000000
--- a/content/warnings/special-props.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: Special Props Warning
-layout: single
-permalink: warnings/special-props.html
----
-
-Most props on a JSX element are passed on to the component, however, there are two special props (`ref` and `key`) which are used by React, and are thus not forwarded to the component.
-
-For instance, attempting to access `this.props.key` from a component (i.e., the render function or [propTypes](/docs/typechecking-with-proptypes.html#proptypes)) is not defined. If you need to access the same value within the child component, you should pass it as a different prop (ex: ``). While this may seem redundant, it's important to separate app logic from reconciling hints.
diff --git a/content/warnings/unknown-prop.md b/content/warnings/unknown-prop.md
deleted file mode 100644
index 783d1b385..000000000
--- a/content/warnings/unknown-prop.md
+++ /dev/null
@@ -1,63 +0,0 @@
----
-title: Unknown Prop Warning
-layout: single
-permalink: warnings/unknown-prop.html
----
-The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as a legal DOM attribute/property. You should ensure that your DOM elements do not have spurious props floating around.
-
-There are a couple of likely reasons this warning could be appearing:
-
-1. Are you using `{...this.props}` or `cloneElement(element, this.props)`? Your component is transferring its own props directly to a child element (eg. [transferring props](/docs/transferring-props.html)). When transferring props to a child component, you should ensure that you are not accidentally forwarding props that were intended to be interpreted by the parent component.
-
-2. You are using a non-standard DOM attribute on a native DOM node, perhaps to represent custom data. If you are trying to attach custom data to a standard DOM element, consider using a custom data attribute as described [on MDN](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes).
-
-3. React does not yet recognize the attribute you specified. This will likely be fixed in a future version of React. However, React currently strips all unknown attributes, so specifying them in your React app will not cause them to be rendered.
-
-4. You are using a React component without an upper case. React interprets it as a DOM tag because [React JSX transform uses the upper vs. lower case convention to distinguish between user-defined components and DOM tags](/docs/jsx-in-depth.html#user-defined-components-must-be-capitalized).
-
----
-
-To fix this, composite components should "consume" any prop that is intended for the composite component and not intended for the child component. Example:
-
-**Bad:** Unexpected `layout` prop is forwarded to the `div` tag.
-
-```js
-function MyDiv(props) {
- if (props.layout === 'horizontal') {
- // BAD! Because you know for sure "layout" is not a prop that
understands.
- return
- } else {
- // BAD! Because you know for sure "layout" is not a prop that
understands.
- return
- }
-}
-```
-
-**Good:** The spread operator can be used to pull variables off props, and put the remaining props into a variable.
-
-```js
-function MyDiv(props) {
- const { layout, ...rest } = props
- if (layout === 'horizontal') {
- return
- } else {
- return
- }
-}
-```
-
-**Good:** You can also assign the props to a new object and delete the keys that you're using from the new object. Be sure not to delete the props from the original `this.props` object, since that object should be considered immutable.
-
-```js
-function MyDiv(props) {
-
- const divProps = Object.assign({}, props);
- delete divProps.layout;
-
- if (props.layout === 'horizontal') {
- return
- } else {
- return
- }
-}
-```
diff --git a/crowdin.yaml b/crowdin.yaml
deleted file mode 100644
index 010aa390d..000000000
--- a/crowdin.yaml
+++ /dev/null
@@ -1,86 +0,0 @@
-project_identifier_env: CROWDIN_REACT_PROJECT_ID
-api_key_env: CROWDIN_REACT_API_KEY
-base_path: "./"
-preserve_hierarchy: true
-
-files:
- -
- source: '/content/docs/*.md'
- translation: '/docs/%locale%/docs/%original_file_name%'
- languages_mapping: &anchor
- locale:
- 'af': 'af'
- 'ar': 'ar'
- 'bs-BA': 'bs-BA'
- 'ca': 'ca'
- 'cs': 'cs'
- 'da': 'da'
- 'de': 'de'
- 'el': 'el'
- 'es-ES': 'es-ES'
- 'fa': 'fa-IR'
- 'fi': 'fi'
- 'fr': 'fr'
- 'he': 'he'
- 'hu': 'hu'
- 'id': 'id-ID'
- 'it': 'it'
- 'ja': 'ja'
- 'ko': 'ko'
- 'mr': 'mr-IN'
- 'nl': 'nl'
- 'no': 'no-NO'
- 'pl': 'pl'
- 'pt-BR': 'pt-BR'
- 'pt-PT': 'pt-PT'
- 'ro': 'ro'
- 'ru': 'ru'
- 'sk': 'sk-SK'
- 'sr': 'sr'
- 'sv-SE': 'sv-SE'
- 'tr': 'tr'
- 'uk': 'uk'
- 'vi': 'vi'
- 'zh-CN': 'zh-Hans'
- 'zh-TW': 'zh-Hant'
- -
- source: '/content/blog/*.md'
- translation: '/docs/%locale%/blog/%original_file_name%'
- languages_mapping: *anchor
- -
- source: '/content/tutorial/*.md'
- translation: '/docs/%locale%/tutorial/%original_file_name%'
- languages_mapping: *anchor
- -
- source: '/content/community/*.md'
- translation: '/docs/%locale%/community/%original_file_name%'
- ignore:
- - '/content/community/complementary-tools.it-IT.md'
- - '/content/community/complementary-tools.ko-KR.md'
- - '/content/community/complementary-tools.zh-CN.md'
- - '/content/community/conferences.it-IT.md'
- - '/content/community/conferences.ko-KR.md'
- - '/content/community/conferences.zh-CN.md'
- - '/content/community/examples.it-IT.md'
- - '/content/community/examples.ko-KR.md'
- - '/content/community/examples.zh-CN.md'
- - '/content/community/videos.it-IT.md'
- - '/content/community/videos.ko-KR.md'
- - '/content/community/videos.zh-CN.md'
- languages_mapping: *anchor
- -
- source: '/content/contributing/*.md'
- translation: '/docs/%locale%/contributing/%original_file_name%'
- languages_mapping: *anchor
- -
- source: '/content/warnings/*.md'
- translation: '/docs/%locale%/warnings/%original_file_name%'
- languages_mapping: *anchor
- -
- source: '/README.md'
- translation: '/docs/%locale%/README.md'
- languages_mapping: *anchor
- -
- source: '/content/404.md'
- translation: '/docs/%locale%/404.md'
- languages_mapping: *anchor
diff --git a/examples/.prettierrc b/examples/.prettierrc
deleted file mode 100644
index bd17fb7e3..000000000
--- a/examples/.prettierrc
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "bracketSpacing": false,
- "jsxBracketSameLine": true,
- "parser": "flow",
- "printWidth": 60,
- "singleQuote": true,
- "trailingComma": "es5"
-}
\ No newline at end of file
diff --git a/examples/16-3-release-blog-post/context-example.js b/examples/16-3-release-blog-post/context-example.js
deleted file mode 100644
index 5d6b43bba..000000000
--- a/examples/16-3-release-blog-post/context-example.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// highlight-next-line
-const ThemeContext = React.createContext('light');
-
-class ThemeProvider extends React.Component {
- state = {theme: 'light'};
-
- render() {
- // highlight-range{2-4}
- return (
-
- {this.props.children}
-
- );
- }
-}
-
-class ThemedButton extends React.Component {
- render() {
- // highlight-range{2-4}
- return (
-
- {theme => }
-
- );
- }
-}
diff --git a/examples/16-3-release-blog-post/create-ref-example.js b/examples/16-3-release-blog-post/create-ref-example.js
deleted file mode 100644
index 12faf96da..000000000
--- a/examples/16-3-release-blog-post/create-ref-example.js
+++ /dev/null
@@ -1,18 +0,0 @@
-class MyComponent extends React.Component {
- constructor(props) {
- super(props);
-
- // highlight-next-line
- this.inputRef = React.createRef();
- }
-
- render() {
- // highlight-next-line
- return ;
- }
-
- componentDidMount() {
- // highlight-next-line
- this.inputRef.current.focus();
- }
-}
diff --git a/examples/16-3-release-blog-post/fancy-button-example.js b/examples/16-3-release-blog-post/fancy-button-example.js
deleted file mode 100644
index f4d5f8e0e..000000000
--- a/examples/16-3-release-blog-post/fancy-button-example.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// highlight-range{1-2}
-const FancyButton = React.forwardRef((props, ref) => (
-
-));
-
-// You can now get a ref directly to the DOM button:
-const ref = React.createRef();
-Click me!;
diff --git a/examples/16-3-release-blog-post/forward-ref-example.js b/examples/16-3-release-blog-post/forward-ref-example.js
deleted file mode 100644
index 6d70efddf..000000000
--- a/examples/16-3-release-blog-post/forward-ref-example.js
+++ /dev/null
@@ -1,41 +0,0 @@
-function withTheme(Component) {
- // highlight-next-line
- function ThemedComponent({forwardedRef, ...rest}) {
- return (
-
- {theme => (
- // Assign the custom prop "forwardedRef" as a ref
- // highlight-next-line
-
- )}
-
- );
- }
-
- // Note the second param "ref" provided by React.forwardRef.
- // We can pass it along to ThemedComponent as a regular prop, e.g. "forwardedRef"
- // And it can then be attached to the Component.
- // highlight-range{1-3}
- return React.forwardRef((props, ref) => (
-
- ));
-}
-
-// Here we assume that FancyButton has been imported into the current scope
-const FancyThemedButton = withTheme(FancyButton);
-
-// Create a ref using the new Referenace API, as above
-// highlight-next-line
-const fancyButtonRef = React.createRef();
-
-// fancyButtonRef will now point to FancyButton
-// highlight-range{4}
-;
diff --git a/examples/16-3-release-blog-post/hoc-theme-example.js b/examples/16-3-release-blog-post/hoc-theme-example.js
deleted file mode 100644
index ba0138def..000000000
--- a/examples/16-3-release-blog-post/hoc-theme-example.js
+++ /dev/null
@@ -1,10 +0,0 @@
-function withTheme(Component) {
- return function ThemedComponent(props) {
- // highlight-range{2-4}
- return (
-
- {theme => }
-
- );
- };
-}
diff --git a/examples/16-4-release-blog-post/pointer-events-example.js b/examples/16-4-release-blog-post/pointer-events-example.js
deleted file mode 100644
index 6c36070f5..000000000
--- a/examples/16-4-release-blog-post/pointer-events-example.js
+++ /dev/null
@@ -1,95 +0,0 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
-
-const CIRCLE_SIZE = 85;
-
-class DragBox extends React.Component {
- state = {
- hasCapture: false,
- circleLeft: 80,
- circleTop: 80,
- };
- isDragging = false;
- previousLeft = 0;
- previousTop = 0;
-
- onDown = event => {
- this.isDragging = true;
- event.target.setPointerCapture(event.pointerId);
-
- // We store the initial coordinates to be able to calculate the changes
- // later on.
- this.extractPositionDelta(event);
- };
-
- onMove = event => {
- if (!this.isDragging) {
- return;
- }
- const {left, top} = this.extractPositionDelta(event);
-
- this.setState(({circleLeft, circleTop}) => ({
- circleLeft: circleLeft + left,
- circleTop: circleTop + top,
- }));
- };
-
- onUp = event => (this.isDragging = false);
- onGotCapture = event => this.setState({hasCapture: true});
- onLostCapture = event =>
- this.setState({hasCapture: false});
-
- extractPositionDelta = event => {
- const left = event.pageX;
- const top = event.pageY;
- const delta = {
- left: left - this.previousLeft,
- top: top - this.previousTop,
- };
- this.previousLeft = left;
- this.previousTop = top;
- return delta;
- };
-
- render() {
- const {hasCapture, circleLeft, circleTop} = this.state;
-
- const boxStyle = {
- border: '1px solid #d9d9d9',
- margin: '10px 0 20px',
- minHeight: 400,
- width: '100%',
- position: 'relative',
- };
-
- const circleStyle = {
- width: CIRCLE_SIZE,
- height: CIRCLE_SIZE,
- borderRadius: CIRCLE_SIZE / 2,
- position: 'absolute',
- left: circleLeft,
- top: circleTop,
- backgroundColor: hasCapture ? 'blue' : 'green',
- touchAction: 'none',
- };
-
- return (
-
;
-}
-
-const element = ;
-ReactDOM.render(element, document.getElementById('root'));
diff --git a/examples/context/motivation-problem.js b/examples/context/motivation-problem.js
deleted file mode 100644
index d166f400a..000000000
--- a/examples/context/motivation-problem.js
+++ /dev/null
@@ -1,24 +0,0 @@
-class App extends React.Component {
- render() {
- return ;
- }
-}
-
-function Toolbar(props) {
- // highlight-range{1-4,7}
- // The Toolbar component must take an extra "theme" prop
- // and pass it to the ThemedButton. This can become painful
- // if every single button in the app needs to know the theme
- // because it would have to be passed through all components.
- return (
-
-
-
- );
-}
-
-class ThemedButton extends React.Component {
- render() {
- return ;
- }
-}
diff --git a/examples/context/motivation-solution.js b/examples/context/motivation-solution.js
deleted file mode 100644
index 5cb4fc7f8..000000000
--- a/examples/context/motivation-solution.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// highlight-range{1-4}
-// Context lets us pass a value deep into the component tree
-// without explicitly threading it through every component.
-// Create a context for the current theme (with "light" as the default).
-const ThemeContext = React.createContext('light');
-
-class App extends React.Component {
- render() {
- // highlight-range{1-3,5}
- // Use a Provider to pass the current theme to the tree below.
- // Any component can read it, no matter how deep it is.
- // In this example, we're passing "dark" as the current value.
- return (
-
-
-
- );
- }
-}
-
-// highlight-range{1,2}
-// A component in the middle doesn't have to
-// pass the theme down explicitly anymore.
-function Toolbar() {
- return (
-
-
-
- );
-}
-
-class ThemedButton extends React.Component {
- // highlight-range{1-3,6}
- // Assign a contextType to read the current theme context.
- // React will find the closest theme Provider above and use its value.
- // In this example, the current theme is "dark".
- static contextType = ThemeContext;
- render() {
- return ;
- }
-}
diff --git a/examples/context/multiple-contexts.js b/examples/context/multiple-contexts.js
deleted file mode 100644
index 54e06df7f..000000000
--- a/examples/context/multiple-contexts.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Theme context, default to light theme
-const ThemeContext = React.createContext('light');
-
-// Signed-in user context
-const UserContext = React.createContext({
- name: 'Guest',
-});
-
-class App extends React.Component {
- render() {
- const {signedInUser, theme} = this.props;
-
- // App component that provides initial context values
- // highlight-range{2-3,5-6}
- return (
-
-
-
-
-
- );
- }
-}
-
-function Layout() {
- return (
-
;
-}
diff --git a/examples/react-component-reference/get-snapshot-before-update.js b/examples/react-component-reference/get-snapshot-before-update.js
deleted file mode 100644
index cf1fb2335..000000000
--- a/examples/react-component-reference/get-snapshot-before-update.js
+++ /dev/null
@@ -1,32 +0,0 @@
-class ScrollingList extends React.Component {
- constructor(props) {
- super(props);
- this.listRef = React.createRef();
- }
-
- getSnapshotBeforeUpdate(prevProps, prevState) {
- // Are we adding new items to the list?
- // Capture the scroll position so we can adjust scroll later.
- if (prevProps.list.length < this.props.list.length) {
- const list = this.listRef.current;
- return list.scrollHeight - list.scrollTop;
- }
- return null;
- }
-
- componentDidUpdate(prevProps, prevState, snapshot) {
- // If we have a snapshot value, we've just added new items.
- // Adjust scroll so these new items don't push the old ones out of view.
- // (snapshot here is the value returned from getSnapshotBeforeUpdate)
- if (snapshot !== null) {
- const list = this.listRef.current;
- list.scrollTop = list.scrollHeight - snapshot;
- }
- }
-
- render() {
- return (
-