You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/2021-12-17-react-conf-2021-recap.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ Looking further into the future, [Xuan Huang (黄玄)](https://twitter.com/Huxpr
86
86
87
87
## React docs keynote {#react-docs-keynote}
88
88
89
-
[Rachel Nabors](https://twitter.com/rachelnabors) kicked off a section of talks about learning and designing with React with a keynote about our investment in React's [new docs](https://beta.reactjs.org/):
89
+
[Rachel Nabors](https://twitter.com/rachelnabors) kicked off a section of talks about learning and designing with React with a keynote about our investment in React's [new docs](https://react.dev/):
90
90
91
91
<iframestyle="margin-top:10px"width="560"height="315"src="https://www.youtube.com/embed/mneDaMYOKP8"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen></iframe>
Copy file name to clipboardExpand all lines: content/blog/2022-06-15-react-labs-what-we-have-been-working-on-june-2022.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Static Site Generation (SSG) and Incremental Static Regeneration (ISR) are great
32
32
33
33
We gave an [early preview](https://www.youtube.com/watch?v=lGEMwh32soc) of React Forget at React Conf 2021. It’s a compiler that automatically generates the equivalent of `useMemo` and `useCallback` calls to minimize the cost of re-rendering, while retaining React’s programming model.
34
34
35
-
Recently, we finished a rewrite of the compiler to make it more reliable and capable. This new architecture allows us to analyze and memoize more complex patterns such as the use of [local mutations](https://beta.reactjs.org/learn/keeping-components-pure#local-mutation-your-components-little-secret), and opens up many new compile-time optimization opportunities beyond just being on par with memoization hooks.
35
+
Recently, we finished a rewrite of the compiler to make it more reliable and capable. This new architecture allows us to analyze and memoize more complex patterns such as the use of [local mutations](https://react.dev/learn/keeping-components-pure#local-mutation-your-components-little-secret), and opens up many new compile-time optimization opportunities beyond just being on par with memoization hooks.
36
36
37
37
We’re also working on a playground for exploring many aspects of the compiler. While the goal of the playground is to make development of the compiler easier, we think that it will make it easier to try it out and build intuition for what the compiler does. It reveals various insights into how it works under the hood, and live renders the compiler’s outputs as you type. This will be shipped together with the compiler when it’s released.
38
38
@@ -63,8 +63,8 @@ We are working on a new version for the Interaction Tracing API (tentatively cal
63
63
64
64
## New React Docs {#new-react-docs}
65
65
66
-
Last year, we announced the [beta version](https://beta.reactjs.org/) of the new React documentation website. The new learning materials teach Hooks first and has new diagrams, illustrations, as well as many interactive examples and challenges. We took a break from that work to focus on the React 18 release, but now that React 18 is out, we’re actively working to finish and ship the new documentation.
66
+
Last year, we announced the [beta version](https://react.dev/) of the new React documentation website. The new learning materials teach Hooks first and has new diagrams, illustrations, as well as many interactive examples and challenges. We took a break from that work to focus on the React 18 release, but now that React 18 is out, we’re actively working to finish and ship the new documentation.
67
67
68
-
We are currently writing a detailed section about effects, as we’ve heard that is one of the more challenging topics for both new and experienced React users. [Synchronizing with Effects](https://beta.reactjs.org/learn/synchronizing-with-effects) is the first published page in the series, and there are more to come in the following weeks. When we first started writing a detailed section about effects, we’ve realized that many common effect patterns can be simplified by adding a new primitive to React. We’ve shared some initial thoughts on that in the [useEvent RFC](https://github.com/reactjs/rfcs/pull/220). It is currently in early research, and we are still iterating on the idea. We appreciate the community’s comments on the RFC so far, as well as the [feedback](https://github.com/reactjs/reactjs.org/issues/3308) and contributions to the ongoing documentation rewrite. We’d specifically like to thank [Harish Kumar](https://github.com/harish-sethuraman) for submitting and reviewing many improvements to the new website implementation.
68
+
We are currently writing a detailed section about effects, as we’ve heard that is one of the more challenging topics for both new and experienced React users. [Synchronizing with Effects](https://react.dev/learn/synchronizing-with-effects) is the first published page in the series, and there are more to come in the following weeks. When we first started writing a detailed section about effects, we’ve realized that many common effect patterns can be simplified by adding a new primitive to React. We’ve shared some initial thoughts on that in the [useEvent RFC](https://github.com/reactjs/rfcs/pull/220). It is currently in early research, and we are still iterating on the idea. We appreciate the community’s comments on the RFC so far, as well as the [feedback](https://github.com/reactjs/reactjs.org/issues/3308) and contributions to the ongoing documentation rewrite. We’d specifically like to thank [Harish Kumar](https://github.com/harish-sethuraman) for submitting and reviewing many improvements to the new website implementation.
69
69
70
70
*Thanks to [Sophie Alpert](https://twitter.com/sophiebits) for reviewing this blog post!*
Copy file name to clipboardExpand all lines: content/docs/add-react-to-a-website.md
+9
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,15 @@ prev: getting-started.html
8
8
next: create-a-new-react-app.html
9
9
---
10
10
11
+
<divclass="scary">
12
+
13
+
>
14
+
> These docs are old and won't be updated. Go to [react.dev](https://react.dev/) for the new React docs.
15
+
>
16
+
> See [Add React to an Existing Project](https://react.dev/learn/add-react-to-an-existing-project) for the recommended ways to add React.
17
+
18
+
</div>
19
+
11
20
Use as little or as much React as you need.
12
21
13
22
React has been designed from the start for gradual adoption, and **you can use as little or as much React as you need**. Perhaps you only want to add some "sprinkles of interactivity" to an existing page. React components are a great way to do that.
Most React apps will have their files "bundled" using tools like [Webpack](https://webpack.js.org/), [Rollup](https://rollupjs.org/) or [Browserify](http://browserify.org/). Bundling is the process of following imported files and merging them into a single file: a "bundle". This bundle can then be included on a webpage to load an entire app at once.
Copy file name to clipboardExpand all lines: content/docs/components-and-props.md
+9-6
Original file line number
Diff line number
Diff line change
@@ -16,14 +16,17 @@ prev: rendering-elements.html
16
16
next: state-and-lifecycle.html
17
17
---
18
18
19
-
> Try the new React documentation.
20
-
>
21
-
> These new documentation pages teach modern React and include live examples:
19
+
<divclass="scary">
20
+
22
21
>
23
-
> -[Your First Component](https://beta.reactjs.org/learn/your-first-component)
24
-
> -[Passing Props to a Component](https://beta.reactjs.org/learn/passing-props-to-a-component)
22
+
> These docs are old and won't be updated. Go to [react.dev](https://react.dev/) for the new React docs.
25
23
>
26
-
> The new docs will soon replace this site, which will be archived. [Provide feedback.](https://github.com/reactjs/reactjs.org/issues/3308)
24
+
> These new documentation pages teach modern React and include live examples:
25
+
>
26
+
> -[Your First Component](https://react.dev/learn/your-first-component)
27
+
> -[Passing Props to a Component](https://react.dev/learn/passing-props-to-a-component)
28
+
29
+
</div>
27
30
28
31
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. This page provides an introduction to the idea of components. You can find a [detailed component API reference here](/docs/react-component.html).
Copy file name to clipboardExpand all lines: content/docs/composition-vs-inheritance.md
+6
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,12 @@ prev: lifting-state-up.html
8
8
next: thinking-in-react.html
9
9
---
10
10
11
+
<divclass="scary">
12
+
13
+
> These docs are old and won't be updated. Go to [react.dev](https://react.dev/) for the new React docs.
14
+
15
+
</div>
16
+
11
17
React has a powerful composition model, and we recommend using composition instead of inheritance to reuse code between components.
12
18
13
19
In this section, we will consider a few problems where developers new to React often reach for inheritance, and show how we can solve them with composition.
In React, you can create distinct components that encapsulate behavior you need. Then, you can render only some of them, depending on the state of your application.
Copy file name to clipboardExpand all lines: content/docs/error-boundaries.md
+10
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,16 @@ title: Error Boundaries
4
4
permalink: docs/error-boundaries.html
5
5
---
6
6
7
+
<divclass="scary">
8
+
9
+
> These docs are old and won't be updated. Go to [react.dev](https://react.dev/) for the new React docs.
10
+
>
11
+
> These new documentation pages teach modern React:
12
+
>
13
+
> -[`React.Component`: Catching rendering errors with an error boundary](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary)
14
+
15
+
</div>
16
+
7
17
In the past, JavaScript errors inside components used to corrupt React’s internal state and cause it to [emit](https://github.com/facebook/react/issues/4026)[cryptic](https://github.com/facebook/react/issues/6895)[errors](https://github.com/facebook/react/issues/8579) on next renders. These errors were always caused by an earlier error in the application code, but React did not provide a way to handle them gracefully in components, and could not recover from them.
HTML form elements work a bit differently from other DOM elements in React, because form elements naturally keep some internal state. For example, this form in plain HTML accepts a single name:
Ref forwarding is a technique for automatically passing a [ref](/docs/refs-and-the-dom.html) through a component to one of its children. This is typically not necessary for most components in the application. However, it can be useful for some kinds of components, especially in reusable component libraries. The most common scenarios are described below.
A common pattern in React is for a component to return multiple elements. Fragments let you group a list of children without adding extra nodes to the DOM.
Copy file name to clipboardExpand all lines: content/docs/higher-order-components.md
+8
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,14 @@ title: Higher-Order Components
4
4
permalink: docs/higher-order-components.html
5
5
---
6
6
7
+
<divclass="scary">
8
+
9
+
> These docs are old and won't be updated. Go to [react.dev](https://react.dev/) for the new React docs.
10
+
>
11
+
> Higher-order components are not commonly used in modern React code.
12
+
13
+
</div>
14
+
7
15
A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API, per se. They are a pattern that emerges from React's compositional nature.
8
16
9
17
Concretely, **a higher-order component is a function that takes a component and returns a new component.**
0 commit comments