Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with react.dev @ bb3a0f5c #87

Merged
merged 10 commits into from
Mar 25, 2024
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
10 changes: 10 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
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
4 changes: 2 additions & 2 deletions src/content/reference/react-dom/components/script.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 Down
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/components/style.md
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion src/content/reference/react/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This section provides detailed reference documentation for working with React. F

</Intro>

Our The React reference documentation is broken down into functional subsections:
The React reference documentation is broken down into functional subsections:

## React {/*react*/}

Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/react/use.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,14 @@ But using `await` in a [Server Component](/reference/react/components#server-com

In some cases a Promise passed to `use` could be rejected. You can handle rejected Promises by either:

1. [Displaying an error to users with error boundary.](#displaying-an-error-to-users-with-error-boundary)
1. [Displaying an error to users with an error boundary.](#displaying-an-error-to-users-with-error-boundary)
2. [Providing an alternative value with `Promise.catch`](#providing-an-alternative-value-with-promise-catch)

<Pitfall>
`use` cannot be called in a try-catch block. Instead of a try-catch block [wrap your component in an Error Boundary](#displaying-an-error-to-users-with-error-boundary), or [provide an alternative value to use with the Promise's `.catch` method](#providing-an-alternative-value-with-promise-catch).
</Pitfall>

#### Displaying an error to users with a error boundary {/*displaying-an-error-to-users-with-error-boundary*/}
#### Displaying an error to users with an error boundary {/*displaying-an-error-to-users-with-error-boundary*/}

If you'd like to display an error to your users when a Promise is rejected, you can use an [error boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary). To use an error boundary, wrap the component where you are calling the `use` Hook in an error boundary. If the Promise passed to `use` is rejected the fallback for the error boundary will be displayed.

Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react/useTransition.md
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ main {

---

### Displaying an error to users with a error boundary {/*displaying-an-error-to-users-with-error-boundary*/}
### Displaying an error to users with an error boundary {/*displaying-an-error-to-users-with-error-boundary*/}

<Canary>

Expand Down
Loading