Skip to content

Commit 7a131b7

Browse files
authored
Merge branch 'main' into translate-api-pureComponent
2 parents 6d83c1d + ebc8d13 commit 7a131b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2275
-359
lines changed

beta/public/images/team/acdlite.jpg

-6.74 MB
Loading

beta/public/images/team/bvaughn.jpg

-388 KB
Binary file not shown.

beta/public/images/team/gaearon.jpg

-350 KB
Loading

beta/public/images/team/huxpro.jpg

-340 KB
Binary file not shown.
232 KB
Loading

beta/public/images/team/joe.jpg

90.2 KB
Loading

beta/public/images/team/josh.jpg

121 KB
Loading

beta/public/images/team/lauren.jpg

147 KB
Loading

beta/public/images/team/lunaruan.jpg

-256 KB
Loading
2.26 MB
Loading

beta/public/images/team/necolas.jpg

-378 KB
Binary file not shown.
-162 KB
Loading

beta/public/images/team/rnabors.jpg

-302 KB
Binary file not shown.

beta/public/images/team/salazarm.jpeg

-75.2 KB
Binary file not shown.

beta/public/images/team/sam.jpg

99.9 KB
Loading

beta/public/images/team/sathya.jpg

69.2 KB
Loading
-137 KB
Loading
160 KB
Loading
167 KB
Loading
-503 KB
Binary file not shown.

beta/public/images/team/tianyu.jpg

51.4 KB
Loading

beta/public/images/team/trueadm.jpg

-64.1 KB
Binary file not shown.

beta/src/components/Icon/IconLink.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*/
4+
5+
import {memo} from 'react';
6+
7+
export const IconLink = memo<JSX.IntrinsicElements['svg']>(function IconLink(
8+
props
9+
) {
10+
return (
11+
<svg
12+
xmlns="http://www.w3.org/2000/svg"
13+
width="1.33em"
14+
height="1.33em"
15+
viewBox="0 -2 24 24"
16+
fill="currentColor"
17+
{...props}>
18+
<path
19+
strokeLinecap="round"
20+
strokeLinejoin="round"
21+
d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"
22+
/>
23+
</svg>
24+
);
25+
});

beta/src/components/Layout/Footer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,13 @@ export function Footer() {
125125
<FooterLink href="https://github.com/facebook/react/blob/main/CODE_OF_CONDUCT.md">
126126
Code of Conduct
127127
</FooterLink>
128-
<FooterLink href="/community/acknowledgements">
128+
<FooterLink href="/learn/acknowledgements">
129129
Acknowledgements
130130
</FooterLink>
131-
<FooterLink href="/community/meet-the-team">
132-
Meet the Team
131+
<FooterLink href="/learn/docs-contributors">
132+
Docs Contributors
133133
</FooterLink>
134+
<FooterLink href="/learn/meet-the-team">Meet the Team</FooterLink>
134135
<FooterLink href="https://reactjs.org/blog">Blog</FooterLink>
135136
{/* <FooterLink href="/">Community Resources</FooterLink> */}
136137
</div>

beta/src/components/MDX/MDXComponents.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {IconNavArrow} from '../Icon/IconNavArrow';
2929
import ButtonLink from 'components/ButtonLink';
3030
import {TocContext} from './TocContext';
3131
import type {Toc, TocItem} from './TocContext';
32+
import {TeamMember} from './TeamMember';
3233

3334
function CodeStep({children, step}: {children: any; step: number}) {
3435
return (
@@ -398,6 +399,7 @@ export const MDXComponents = {
398399
Recap,
399400
Recipes,
400401
Sandpack,
402+
TeamMember,
401403
TerminalBlock,
402404
YouWillLearn,
403405
YouWillLearnCard,
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*/
4+
5+
import * as React from 'react';
6+
import Image from 'next/image';
7+
import {IconTwitter} from '../Icon/IconTwitter';
8+
import {IconGitHub} from '../Icon/IconGitHub';
9+
import {ExternalLink} from '../ExternalLink';
10+
import {IconNewPage} from 'components/Icon/IconNewPage';
11+
import {H3} from './Heading';
12+
import {IconLink} from 'components/Icon/IconLink';
13+
14+
interface TeamMemberProps {
15+
name: string;
16+
title: string;
17+
permalink: string;
18+
children: React.ReactNode;
19+
photo: string;
20+
twitter?: string;
21+
github?: string;
22+
personal?: string;
23+
}
24+
25+
// TODO: good alt text for images/links
26+
export function TeamMember({
27+
name,
28+
title,
29+
permalink,
30+
children,
31+
photo,
32+
github,
33+
twitter,
34+
personal,
35+
}: TeamMemberProps) {
36+
if (name == null || title == null || permalink == null || children == null) {
37+
throw new Error(
38+
'Expected name, title, permalink, and children for ' + name ??
39+
title ??
40+
permalink ??
41+
'unknown'
42+
);
43+
}
44+
return (
45+
<div className="pb-6 sm:pb-10">
46+
<div className="flex flex-col sm:flex-row height-auto">
47+
<div
48+
className="hidden sm:block basis-2/5 rounded overflow-hidden relative"
49+
style={{width: 300, height: 250}}>
50+
<Image src={photo} layout="fill" objectFit="cover" alt={name} />
51+
</div>
52+
<div
53+
style={{minHeight: 300}}
54+
className="block w-full sm:hidden flex-grow basis-2/5 rounded overflow-hidden relative">
55+
<Image src={photo} layout="fill" objectFit="cover" alt={name} />
56+
</div>
57+
<div className="pl-0 sm:pl-6 basis-3/5 items-start">
58+
<H3 className="mb-1 sm:my-0" id={permalink}>
59+
{name}
60+
</H3>
61+
{title && <div>{title}</div>}
62+
{children}
63+
<div className="sm:flex sm:flex-row">
64+
{twitter && (
65+
<div className="mr-4">
66+
<ExternalLink
67+
aria-label="React on Twitter"
68+
href={`https://twitter.com/${twitter}`}
69+
className="hover:text-primary dark:text-primary-dark flex flex-row items-center">
70+
<IconTwitter className="pr-2" />
71+
{twitter}
72+
</ExternalLink>
73+
</div>
74+
)}
75+
{github && (
76+
<div className="mr-4">
77+
<ExternalLink
78+
aria-label="GitHub Profile"
79+
href={`https://github.com/${github}`}
80+
className="hover:text-primary dark:text-primary-dark flex flex-row items-center">
81+
<IconGitHub className="pr-2" /> {github}
82+
</ExternalLink>
83+
</div>
84+
)}
85+
{personal && (
86+
<ExternalLink
87+
aria-label="Personal Site"
88+
href={`https://${personal}`}
89+
className="hover:text-primary dark:text-primary-dark flex flex-row items-center">
90+
<IconLink className="pr-2" /> {personal}
91+
</ExternalLink>
92+
)}
93+
</div>
94+
</div>
95+
</div>
96+
</div>
97+
);
98+
}

beta/src/content/apis/react-dom/client/createRoot.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ It is uncommon to call `render` multiple times. Usually, you'll [update state](/
233233
---
234234
## Reference {/*reference*/}
235235

236-
### `createRoot(domNode, options?)` {/*create-root*/}
236+
### `createRoot(domNode, options?)` {/*createroot*/}
237237

238238
Call `createRoot` to create a React root for displaying content inside a browser DOM element.
239239

@@ -254,13 +254,13 @@ An app fully built with React will usually only have one `createRoot` call for i
254254
255255
#### Parameters {/*parameters*/}
256256
257-
258257
* `domNode`: A [DOM element.](https://developer.mozilla.org/en-US/docs/Web/API/Element) React will create a root for this DOM element and allow you to call functions on the root, such as `render` to display rendered React content.
259258
260-
* **optional** `options`: A object contain options for this React root.
259+
* **optional** `options`: An object with options for this React root.
260+
261+
* **optional** `onRecoverableError`: Callback called when React automatically recovers from errors.
262+
* **optional** `identifierPrefix`: A string prefix React uses for IDs generated by [`useId`.](/apis/react/useId) Useful to avoid conflicts when using multiple roots on the same page.
261263
262-
* `onRecoverableError`: optional callback called when React automatically recovers from errors.
263-
* `identifierPrefix`: optional prefix React uses for IDs generated by [`useId`.](/apis/react/useId) Useful to avoid conflicts when using multiple roots on the same page.
264264
#### Returns {/*returns*/}
265265
266266
`createRoot` returns an object with two methods: [`render`](#root-render) and [`unmount`.](#root-unmount)

0 commit comments

Comments
 (0)