Skip to content

Commit

Permalink
Merge pull request #735 from reactjs/sync-35530eea
Browse files Browse the repository at this point in the history
Sync with react.dev @ 35530ee
  • Loading branch information
smikitky authored Feb 20, 2024
2 parents 54d36bf + 56e3775 commit 3c933f5
Show file tree
Hide file tree
Showing 16 changed files with 176 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/components/Layout/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function Page({children, toc, routeTree, meta, section}: PageProps) {
'grid grid-cols-only-content lg:grid-cols-sidebar-content 2xl:grid-cols-sidebar-content-toc'
)}>
{showSidebar && (
<div className="lg:-mt-16">
<div className="lg:-mt-16 z-10">
<div className="fixed top-0 py-0 shadow lg:pt-16 lg:sticky start-0 end-0 lg:shadow-none">
<SidebarNav
key={section}
Expand Down
6 changes: 3 additions & 3 deletions src/components/MDX/SandpackWithHTMLOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function ShowRenderedHTML({children}) {
{formatHTML(markup)}
</pre>
</>
);
);
}`;

const formatHTML = `
Expand Down Expand Up @@ -77,8 +77,8 @@ export default memo(function SandpackWithHTMLOutput(
) {
const children = [
...Children.toArray(props.children),
createFile('ShowRenderedHTML.js', ShowRenderedHTML),
createFile('formatHTML.js hidden', formatHTML),
createFile('src/ShowRenderedHTML.js', ShowRenderedHTML),
createFile('src/formatHTML.js hidden', formatHTML),
createFile('package.json hidden', packageJSON),
];
return <Sandpack {...props}>{children}</Sandpack>;
Expand Down
8 changes: 3 additions & 5 deletions src/components/SocialBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {useRef, useEffect} from 'react';
import cn from 'classnames';
import {ExternalLink} from './ExternalLink';

const bannerText = 'Support Ukraine 🇺🇦';
const bannerLink = 'https://opensource.fb.com/support-ukraine';
const bannerLinkText = 'Help Provide Humanitarian Aid to Ukraine';
const bannerText = 'Join us for React Conf on May 15-16.';
const bannerLink = 'https://conf.react.dev/';
const bannerLinkText = 'Learn more.';

export default function SocialBanner() {
const ref = useRef<HTMLDivElement | null>(null);
Expand Down Expand Up @@ -39,9 +39,7 @@ export default function SocialBanner() {
<ExternalLink
className="ms-0 sm:ms-1 text-link dark:text-link-dark hover:underline"
href={bannerLink}>
<div className="inline sm:hidden">🇺🇦 </div>
{bannerLinkText}
<span className="hidden sm:inline">.</span>
</ExternalLink>
</div>
);
Expand Down

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/content/blog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ React チームからの公式な更新のお知らせはこのブログに掲

<div className="sm:-mx-5 flex flex-col gap-5 mt-12">

<BlogCard title="React Labs: 私達のこれまでの取り組み - 2024年2月版" date="February 15, 2024" url="/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024">

React Labs 記事では、現在活発に研究・開発が行われているプロジェクトについて述べていきます。前回のアップデート以降に、React Compiler、新機能、React 19 に関する大きな進展がありましたので、我々が学んだことを共有していきます。

</BlogCard>

<BlogCard title="React Canary: Meta 外での段階的な新機能導入" date="May 3, 2023" url="/blog/2023/05/03/react-canaries">

従来、React の新機能は Meta 社内で先に利用可能になり、オープンソースでのリリースは後になっていました。私たちは、Meta 社内での React 使用法と同様に、安定版がリリースされる前に個々の新機能の設計がほぼ確定した段階でそれらを採用できるという選択肢を、React コミュニティに提供したいと考えています。私たちは、新たに公式サポート対象となる Canary リリースチャンネルを導入します。これにより、フレームワークのような統合済セットアップが、個々の React 機能の採用を React のリリーススケジュールから切り離して行えるようになります。
Expand Down
15 changes: 15 additions & 0 deletions src/content/community/conferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ April 19 - 20, 2024. In-person in Miami, FL, USA

[Website](https://reactmiami.com/) - [Twitter](https://twitter.com/ReactMiamiConf)

### React Connection 2024 {/*react-connection-2024*/}
April 22, 2024. In-person in Paris, France

[Website](https://reactconnection.io/) - [Twitter](https://twitter.com/ReactConn)

### React Native Connection 2024 {/*react-native-connection-2024*/}
April 23, 2024. In-person in Paris, France

[Website](https://reactnativeconnection.io/) - [Twitter](https://twitter.com/ReactNativeConn)

### React Conf 2024 {/*react-conf-2024*/}
May 15 - 16, 2024. In-person in Henderson, NV, USA + remote

Expand Down Expand Up @@ -55,6 +65,11 @@ July 04 & 05, 2024. Bangalore, India (In-person event)

[Website](https://reactnexus.com/) - [Twitter](https://twitter.com/ReactNexus) - [Linkedin](https://www.linkedin.com/company/react-nexus) - [YouTube](https://www.youtube.com/reactify_in)

### Chain React 2024 {/*chain-react-2024*/}
July 17-19, 2024. In-person in Portland, OR, USA

[Website](https://chainreactconf.com) - [Twitter](https://twitter.com/ChainReactConf)

### React India 2024 {/*react-india-2024*/}
October 17 - 19, 2024. In-person in Goa, India (hybrid event) + Oct 15 2024 - remote day

Expand Down
1 change: 1 addition & 0 deletions src/content/learn/reacting-to-input-with-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ body { margin: 0; padding: 0; height: 250px; }
width: 200px;
height: 200px;
border-radius: 10px;
border: 5px solid transparent;
}

.picture--active {
Expand Down
10 changes: 5 additions & 5 deletions src/content/reference/react-dom/components/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ In addition, if the `<link>` is to a stylesheet (namely, it has `rel="stylesheet

There are two exception to this special behavior:

* If the link doesn't have a `precedence` prop, there is no special behavior, because the order of stylesheets within the document is significant, so React needs to know how to order this stylesheet relative to others, which you specify using the `precedence` prop.
* If the link doesn't have a `precedence` prop, there is no special behavior, because the order of stylesheets within the document is significant, so React needs to know how to order this stylesheet relative to others, which you specify using the `precedence` prop.
* If you supply any of the `onLoad`, `onError`, or `disabled` props, there is no special behavior, because these props indicate that you are managing the loading of the stylesheet manually within your component.

This special treatment comes with two caveats:
Expand All @@ -114,7 +114,7 @@ You can annotate the document with links to related resources such as an icon, c

<SandpackWithHTMLOutput>

```js App.js active
```js src/App.js active
import ShowRenderedHTML from './ShowRenderedHTML.js';

export default function BlogPage() {
Expand All @@ -141,7 +141,7 @@ When you want to use a stylesheet, it can be beneficial to call the [preinit](/r

<SandpackWithHTMLOutput>

```js App.js active
```js src/App.js active
import ShowRenderedHTML from './ShowRenderedHTML.js';

export default function SiteMapPage() {
Expand All @@ -164,7 +164,7 @@ Stylesheets can conflict with each other, and when they do, the browser goes wit

<SandpackWithHTMLOutput>

```js App.js active
```js src/App.js active
import ShowRenderedHTML from './ShowRenderedHTML.js';

export default function HomePage() {
Expand Down Expand Up @@ -195,7 +195,7 @@ If you render the same stylesheet from multiple components, React will place onl

<SandpackWithHTMLOutput>

```js App.js active
```js src/App.js active
import ShowRenderedHTML from './ShowRenderedHTML.js';

export default function HomePage() {
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/components/meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ You can render the `<meta>` component from any component. React will put a `<met

<SandpackWithHTMLOutput>

```js App.js active
```js src/App.js active
import ShowRenderedHTML from './ShowRenderedHTML.js';

export default function SiteMapPage() {
Expand Down
8 changes: 4 additions & 4 deletions src/content/reference/react-dom/components/script.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Props that are **not recommended** for use with React:

#### Special rendering behavior {/*special-rendering-behavior*/}

React can move `<script>` components to the document's `<head>`, de-duplicate identical scripts, and [suspend](http://localhost:3000/reference/react/Suspense) while the script is loading.
React can move `<script>` components to the document's `<head>`, de-duplicate identical scripts, and [suspend](/reference/react/Suspense) while the script is loading.

To opt into this behavior, provide the `src` and `async={true}` props. React will de-duplicate scripts if they have the same `src`. The `async` prop must be true to allow scripts to be safely moved.

Expand All @@ -91,7 +91,7 @@ If you supply an `src` and `async` prop, your component will suspend while the s

<SandpackWithHTMLOutput>

```js App.js active
```js src/App.js active
import ShowRenderedHTML from './ShowRenderedHTML.js';

function Map({lat, long}) {
Expand Down Expand Up @@ -124,7 +124,7 @@ To include an inline script, render the `<script>` component with the script sou

<SandpackWithHTMLOutput>

```js App.js active
```js src/App.js active
import ShowRenderedHTML from './ShowRenderedHTML.js';

function Tracking() {
Expand All @@ -146,4 +146,4 @@ export default function Page() {
}
```

</SandpackWithHTMLOutput>
</SandpackWithHTMLOutput>
6 changes: 3 additions & 3 deletions src/content/reference/react-dom/components/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ React's extensions to `<style>` are currently only available in React's canary a
The [built-in browser `<style>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style) lets you add inline CSS stylesheets to your document.

```js
<style> p { color: red; } </style>
<style>{` p { color: red; } `}</style>
```

</Intro>
Expand All @@ -30,7 +30,7 @@ The [built-in browser `<style>` component](https://developer.mozilla.org/en-US/d
To add inline styles to your document, render the [built-in browser `<style>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style). You can render `<style>` from any component and React will [in certain cases](#special-rendering-behavior) place the corresponding DOM element in the document head and de-duplicate identical styles.

```js
<style> p { color: red; } </style>
<style>{` p { color: red; } `}</style>
```

[See more examples below.](#usage)
Expand Down Expand Up @@ -73,7 +73,7 @@ If you supply an `href` and `precedence` prop, your component will suspend while

<SandpackWithHTMLOutput>

```js App.js active
```js src/App.js active
import ShowRenderedHTML from './ShowRenderedHTML.js';
import { useId } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/components/title.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Render the `<title>` component from any component with text as its children. Rea

<SandpackWithHTMLOutput>

```js App.js active
```js src/App.js active
import ShowRenderedHTML from './ShowRenderedHTML.js';

export default function ContactUsPage() {
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/preload.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function AppRoot() {
}
```

When preloading an image, the `imageSrcSet` and `imageSizes` options help the browser [fetch the correctly sized image for the size of the screen]((https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images)).
When preloading an image, the `imageSrcSet` and `imageSizes` options help the browser [fetch the correctly sized image for the size of the screen](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).

<Solution />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ experimental_taintUniqueValue(
);
```

Now whenever anyone tries to pass this password to a Client Component, or send the password to a Client Component with a Server Action, a error will be thrown with message you defined when you called `taintUniqueValue`.
Now whenever anyone tries to pass this password to a Client Component, or send the password to a Client Component with a Server Action, an error will be thrown with message you defined when you called `taintUniqueValue`.

</DeepDive>

Expand Down
7 changes: 7 additions & 0 deletions src/content/warnings/react-test-renderer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: react-test-renderer Deprecation Warning
---

react-test-renderer is deprecated. A warning will fire whenever calling ReactTestRenderer.create() or ReactShallowRender.render(). The react-test-renderer package will remain available on NPM but will not be maintained and may break with new React features or changes to React's internals.

The React Team recommends migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/docs/getting-started) for a modern and well supported testing experience.
7 changes: 7 additions & 0 deletions src/sidebarBlog.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"path": "/blog",
"skipBreadcrumb": true,
"routes": [
{
"title": "React Labs: What We've Been Working On – February 2024",
"titleForHomepage": "React Labs: February 2024",
"icon": "labs",
"date": "February 15, 2024",
"path": "/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024"
},
{
"title": "React Canary: Meta 外での段階的な新機能導入",
"titleForHomepage": "React Canaries: 段階的な新機能導入",
Expand Down

0 comments on commit 3c933f5

Please sign in to comment.