GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update some READMEs (#24290) · react/react@bb49abe

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • react-dom
      • README.md
    • react
      • README.md
    • use-sync-external-store
      • README.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-dom/README.md‎

Copy file name to clipboardExpand all lines: packages/react-dom/README.md
+23-13Lines changed: 23 additions & 13 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,48 @@ npm install react react-dom
1313
### In the browser
1414

1515
```js
16-
var React = require('react');
17-
var ReactDOM = require('react-dom');
16+
import { createRoot } from 'react-dom';
1817

19-
function MyComponent() {
18+
function App() {
2019
return <div>Hello World</div>;
2120
}
2221

23-
ReactDOM.render(<MyComponent />, node);
22+
const root = createRoot(document.getElementById('root'));
23+
root.render(<App />);
2424
```
2525

2626
### On the server
2727

2828
```js
29-
var React = require('react');
30-
var ReactDOMServer = require('react-dom/server');
29+
import { renderToPipeableStream } from 'react-dom/server';
3130

32-
function MyComponent() {
31+
function App() {
3332
return <div>Hello World</div>;
3433
}
3534

36-
ReactDOMServer.renderToString(<MyComponent />);
35+
function handleRequest(res) {
36+
// ... in your server handler ...
37+
const stream = renderToPipeableStream(<App />, {
38+
onShellReady() {
39+
res.statusCode = 200;
40+
res.setHeader('Content-type', 'text/html');
41+
stream.pipe(res);
42+
},
43+
// ...
44+
});
45+
}
3746
```
3847

3948
## API
4049

4150
### `react-dom`
4251

43-
- `findDOMNode`
44-
- `render`
45-
- `unmountComponentAtNode`
52+
See https://reactjs.org/docs/react-dom.html
53+
54+
### `react-dom/client`
55+
56+
See https://reactjs.org/docs/react-dom-client.html
4657

4758
### `react-dom/server`
4859

49-
- `renderToString`
50-
- `renderToStaticMarkup`
60+
See https://reactjs.org/docs/react-dom-server.html
Collapse file

‎packages/react/README.md‎

Copy file name to clipboardExpand all lines: packages/react/README.md
+26-2Lines changed: 26 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,32 @@ The `react` package contains only the functionality necessary to define React co
66

77
**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the [production build](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) when deploying your application.
88

9-
## Example Usage
9+
## Usage
1010

1111
```js
12-
var React = require('react');
12+
import { useState } from 'react';
13+
import { createRoot } from 'react-dom';
14+
15+
function Counter() {
16+
const [count, setCount] = useState(0);
17+
return (
18+
<>
19+
<h1>{count}</h1>
20+
<button onClick={() => setCount(count + 1)}>
21+
Increment
22+
</button>
23+
</>
24+
);
25+
}
26+
27+
const root = createRoot(document.getElementById('root'));
28+
root.render(<App />);
1329
```
30+
31+
## Documentation
32+
33+
See https://reactjs.org/
34+
35+
## API
36+
37+
See https://reactjs.org/docs/react-api.html
Collapse file

‎packages/use-sync-external-store/README.md‎

Copy file name to clipboard
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# use-sync-external-store
22

3-
Backwards compatible shim for React's `useSyncExternalStore`. Works with any React that supports hooks.
3+
Backwards-compatible shim for [`React.useSyncExternalStore`](https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore). Works with any React that supports Hooks.
44

5-
Until `useSyncExternalStore` is documented, refer to https://github.com/reactwg/react-18/discussions/86
5+
See also https://github.com/reactwg/react-18/discussions/86.

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.