Skip to content

Commit b4874d3

Browse files
committed
Merge branch 'main' of https://github.com/reactjs/reactjs.org into sync-420c2f64
2 parents 0dc7d80 + 420c2f6 commit b4874d3

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/components/Layout/Page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {useRouter} from 'next/router';
88
import {SidebarNav} from './SidebarNav';
99
import {Footer} from './Footer';
1010
import {Toc} from './Toc';
11-
// import SocialBanner from '../SocialBanner';
11+
import SocialBanner from '../SocialBanner';
1212
import {DocsPageFooter} from 'components/DocsFooter';
1313
import {Seo} from 'components/Seo';
1414
import PageHeading from 'components/PageHeading';
@@ -137,7 +137,7 @@ export function Page({
137137
/>
138138
</Head>
139139
)}
140-
{/*<SocialBanner />*/}
140+
<SocialBanner />
141141
<TopNav
142142
section={section}
143143
routeTree={routeTree}

src/components/SocialBanner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {useRef, useEffect} from 'react';
77
import cn from 'classnames';
88
import {ExternalLink} from './ExternalLink';
99

10-
const bannerText = 'Stream React Conf on May 15-16.';
10+
const bannerText = 'Join us for React Conf on Oct 7-8.';
1111
const bannerLink = 'https://conf.react.dev/';
1212
const bannerLinkText = 'Learn more.';
1313

src/content/reference/react-dom/client/createRoot.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ React 将会在 `根节点` 中显示 `<App />` 组件,并且控制组件中
9090
9191
如果你在一个根节点上多次调用了 `render`,React 仍然会更新 DOM,这样才能保证显示的内容是最新的。React 将会筛选出可复用的部分和需要更新的部分,对于需要更新的部分,是 React 通过与之前渲染的树进行 [“比较”](/learn/preserving-and-resetting-state) 得到的。在同一个根节点上再次调用 `render` 就和在根节点上调用 [`set` 函数](/reference/react/useState#setstate) 类似:React 会避免没必要的 DOM 更新。
9292
93+
* Although rendering is synchronous once it starts, `root.render(...)` is not. This means code after `root.render()` may run before any effects (`useLayoutEffect`, `useEffect`) of that specific render are fired. This is usually fine and rarely needs adjustment. In rare cases where effect timing matters, you can wrap `root.render(...)` in [`flushSync`](https://react.dev/reference/react-dom/client/flushSync) to ensure the initial render runs fully synchronously.
94+
95+
```js
96+
const root = createRoot(document.getElementById('root'));
97+
root.render(<App />);
98+
// 🚩 The HTML will not include the rendered <App /> yet:
99+
console.log(document.body.innerHTML);
100+
```
101+
93102
---
94103
95104
### `root.unmount()` {/*root-unmount*/}

0 commit comments

Comments
 (0)