Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
[Beta] Remove some duplicated banners
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Dec 25, 2022
1 parent 3473846 commit 8d51b16
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 87 deletions.
12 changes: 0 additions & 12 deletions beta/src/content/reference/react-dom/findDOMNode.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ const domNode = findDOMNode(componentInstance)

### `findDOMNode(componentInstance)` {/*finddomnode*/}

<Deprecated>

This API will be removed in a future major version of React. [See the alternatives.](#alternatives)

</Deprecated>

Call `findDOMNode` to find the browser DOM node for a given React [class component](/reference/react/Component) instance.

```js
Expand Down Expand Up @@ -65,12 +59,6 @@ const domNode = findDOMNode(componentInstance);

### Finding the root DOM node of a class component {/*finding-the-root-dom-node-of-a-class-component*/}

<Deprecated>

This API will be removed in a future major version of React. [See the alternatives.](#alternatives)

</Deprecated>

Call `findDOMNode` with a [class component](/reference/react/Component) instance (usually, `this`) to find the DOM node it has rendered.

```js {3}
Expand Down
12 changes: 2 additions & 10 deletions beta/src/content/reference/react-dom/hydrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ title: hydrate

<Deprecated>

In React 18, `hydrate` was replaced by [`hydrateRoot`.](/reference/react-dom/client/hydrateRoot) Using `hydrate` in React 18 will warn that your app will behave as if it’s running React 17. Learn more [here.](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis)

This API will be removed in a future major version of React.

In React 18, `hydrate` was replaced by [`hydrateRoot`.](/reference/react-dom/client/hydrateRoot) Using `hydrate` in React 18 will warn that your app will behave as if it’s running React 17. Learn more [here.](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis)

</Deprecated>

<Intro>
Expand All @@ -28,14 +28,6 @@ hydrate(reactNode, domNode, callback?)
### `hydrate(reactNode, domNode, callback?)` {/*hydrate*/}
<Deprecated>
In React 18, `hydrate` was replaced by [`hydrateRoot`.](/reference/react-dom/client/hydrateRoot) Using `hydrate` in React 18 will warn that your app will behave as if it’s running React 17. Learn more [here.](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis)
This API will be removed in a future major version of React.
</Deprecated>
Call `hydrate` in React 17 and below to “attach” React to existing HTML that was already rendered by React in a server environment.
```js
Expand Down
12 changes: 2 additions & 10 deletions beta/src/content/reference/react-dom/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ title: render

<Deprecated>

In React 18, `render` was replaced by [`createRoot`.](/reference/react-dom/client/createRoot) Using `render` in React 18 will warn that your app will behave as if it’s running React 17. Learn more [here.](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis)

This API will be removed in a future major version of React.

In React 18, `render` was replaced by [`createRoot`.](/reference/react-dom/client/createRoot) Using `render` in React 18 will warn that your app will behave as if it’s running React 17. Learn more [here.](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis)

</Deprecated>

<Intro>
Expand All @@ -28,14 +28,6 @@ render(reactNode, domNode, callback?)
### `render(reactNode, domNode, callback?)` {/*render*/}
<Deprecated>
In React 18, `render` was replaced by [`createRoot`.](/reference/react-dom/client/createRoot) Using `render` in React 18 will warn that your app will behave as if it’s running React 17. Learn more [here.](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis)
This API will be removed in a future major version of React.
</Deprecated>
Call `render` to display a React component inside a browser DOM element.
```js
Expand Down
12 changes: 0 additions & 12 deletions beta/src/content/reference/react-dom/server/renderToNodeStream.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ const stream = renderToNodeStream(reactNode)

### `renderToNodeStream(reactNode)` {/*rendertonodestream*/}

<Deprecated>

This API will be removed in a future major version of React. Use [`renderToPipeableStream`](/reference/react-dom/server/renderToPipeableStream) instead.

</Deprecated>

On the server, call `renderToNodeStream` to get a [Node.js Readable Stream](https://nodejs.org/api/stream.html#readable-streams) which you can pipe into the response.

```js
Expand Down Expand Up @@ -63,12 +57,6 @@ A [Node.js Readable Stream](https://nodejs.org/api/stream.html#readable-streams)

### Rendering a React tree as HTML to a Node.js Readable Stream {/*rendering-a-react-tree-as-html-to-a-nodejs-readable-stream*/}

<Deprecated>

This API will be removed in a future major version of React. Use [`renderToPipeableStream`](/reference/react-dom/server/renderToPipeableStream) instead.

</Deprecated>

Call `renderToNodeStream` to get a [Node.js Readable Stream](https://nodejs.org/api/stream.html#readable-streams) which you can pipe to your server response:

```js {5-6}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ A [Node.js Readable Stream](https://nodejs.org/api/stream.html#readable-streams)

* The returned stream is a byte stream encoded in utf-8. If you need a stream in another encoding, take a look at a project like [iconv-lite](https://www.npmjs.com/package/iconv-lite), which provides transform streams for transcoding text.

---

## Usage {/*usage*/}

### Rendering a React tree as static HTML to a Node.js Readable Stream {/*rendering-a-react-tree-as-static-html-to-a-nodejs-readable-stream*/}
Expand All @@ -72,6 +74,3 @@ This method renders **non-interactive HTML that cannot be hydrated.** This is us
Interactive apps should use [`renderToPipeableStream`](/reference/react-dom/server/renderToPipeableStream) on the server and [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) on the client.

</Pitfall>

---

12 changes: 2 additions & 10 deletions beta/src/content/reference/react-dom/unmountComponentAtNode.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ title: unmountComponentAtNode

<Deprecated>

In React 18, `unmountComponentAtNode` was replaced by [`root.unmount()`](/reference/react-dom/client/createRoot#root-unmount).

This API will be removed in a future major version of React.

In React 18, `unmountComponentAtNode` was replaced by [`root.unmount()`](/reference/react-dom/client/createRoot#root-unmount).

</Deprecated>

<Intro>
Expand All @@ -28,14 +28,6 @@ unmountComponentAtNode(domNode)

### `unmountComponentAtNode(domNode)` {/*unmountcomponentatnode*/}

<Deprecated>

In React 18, `unmountComponentAtNode` was replaced by [`root.unmount()`](/reference/react-dom/client/createRoot#root-unmount).

This API will be removed in a future major version of React.

</Deprecated>

Call `unmountComponentAtNode` to remove a mounted React component from the DOM and clean up its event handlers and state.

```js
Expand Down
6 changes: 0 additions & 6 deletions beta/src/content/reference/react/Component.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ class Greeting extends Component {

## Reference {/*reference*/}

<Pitfall>

We recommend to define components as functions instead of classes. [See how to migrate.](#alternatives)

</Pitfall>

### `Component` {/*component*/}

To define a React component as a class, extend the built-in `Component` class and define a [`render` method:](#render)
Expand Down
12 changes: 0 additions & 12 deletions beta/src/content/reference/react/createFactory.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ const factory = createFactory(type)

### `createFactory(type)` {/*createfactory*/}

<Deprecated>

This API will be removed in a future major version of React. [See the alternatives.](#alternatives)

</Deprecated>

Call `createFactory(type)` to create a factory function which produces React elements of a given `type`.

```js
Expand Down Expand Up @@ -66,12 +60,6 @@ Returns a factory function. That factory function receives a `props` object as t

### Creating React elements with a factory {/*creating-react-elements-with-a-factory*/}

<Deprecated>

This API will be removed in a future major version of React. [See the alternatives.](#alternatives)

</Deprecated>

Although most React projects use [JSX](/learn/writing-markup-with-jsx) to describe the user interface, JSX is not required. In the past, `createFactory` used to be one of the ways you could describe the user interface without JSX.

Call `createFactory` to create a *factory function* for a specific element type like `'button'`:
Expand Down
6 changes: 0 additions & 6 deletions beta/src/content/reference/react/createRef.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ class MyComponent extends Component {
// ...
```
<Pitfall>
`createRef` is mostly used for [class components.](/reference/react/Component) Function components typically rely on [`useRef`](/reference/react/useRef) instead.
</Pitfall>
#### Parameters {/*parameters*/}
`createRef` takes no parameters.
Expand Down
6 changes: 0 additions & 6 deletions beta/src/content/reference/react/useInsertionEffect.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ useInsertionEffect(setup, dependencies?)
### `useInsertionEffect(setup, dependencies?)` {/*useinsertioneffect*/}
<Pitfall>
`useInsertionEffect` is aimed at CSS-in-JS library authors. Unless you are working on a CSS-in-JS library and need a place to inject the styles, you probably want [`useEffect`](/reference/react/useEffect) or [`useLayoutEffect`](/reference/react/useLayoutEffect) instead.
</Pitfall>
Call `useInsertionEffect` to insert the styles before any DOM mutations:
```js
Expand Down

0 comments on commit 8d51b16

Please sign in to comment.