Skip to content

Commit d5f50cf

Browse files
committed
Merge branch 'main' into tr/components-common
2 parents b18d317 + 84bd9b1 commit d5f50cf

31 files changed

+457
-458
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"plugins": ["@typescript-eslint"],
66
"rules": {
77
"no-unused-vars": "off",
8-
"@typescript-eslint/no-unused-vars": "warn"
8+
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
9+
"react-hooks/exhaustive-deps": "error"
910
},
1011
"env": {
1112
"node": true,

src/components/Layout/HomeContent.js

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import {
88
useState,
99
useContext,
1010
useId,
11-
Fragment,
1211
Suspense,
1312
useEffect,
1413
useRef,
1514
useTransition,
16-
useReducer,
1715
} from 'react';
1816
import cn from 'classnames';
1917
import NextLink from 'next/link';
@@ -26,7 +24,6 @@ import {IconSearch} from 'components/Icon/IconSearch';
2624
import {Logo} from 'components/Logo';
2725
import Link from 'components/MDX/Link';
2826
import CodeBlock from 'components/MDX/CodeBlock';
29-
import {IconNavArrow} from 'components/Icon/IconNavArrow';
3027
import {ExternalLink} from 'components/ExternalLink';
3128
import sidebarBlog from '../../sidebarBlog.json';
3229

@@ -67,14 +64,6 @@ function Para({children}) {
6764
);
6865
}
6966

70-
function Left({children}) {
71-
return (
72-
<div className="px-5 lg:px-0 max-w-4xl lg:text-left text-white text-opacity-80">
73-
{children}
74-
</div>
75-
);
76-
}
77-
7867
function Center({children}) {
7968
return (
8069
<div className="px-5 lg:px-0 max-w-4xl lg:text-center text-white text-opacity-80 flex flex-col items-center justify-center">
@@ -90,19 +79,23 @@ function FullBleed({children}) {
9079
}
9180

9281
function CurrentTime() {
93-
const msPerMinute = 60 * 1000;
94-
const date = new Date();
95-
let nextMinute = Math.floor(+date / msPerMinute + 1) * msPerMinute;
96-
82+
const [date, setDate] = useState(new Date());
9783
const currentTime = date.toLocaleTimeString([], {
9884
hour: 'numeric',
9985
minute: 'numeric',
10086
});
101-
let [, forceUpdate] = useReducer((n) => n + 1, 0);
10287
useEffect(() => {
103-
const timeout = setTimeout(forceUpdate, nextMinute - Date.now());
88+
const msPerMinute = 60 * 1000;
89+
let nextMinute = Math.floor(+date / msPerMinute + 1) * msPerMinute;
90+
91+
const timeout = setTimeout(() => {
92+
if (Date.now() > nextMinute) {
93+
setDate(new Date());
94+
}
95+
}, nextMinute - Date.now());
10496
return () => clearTimeout(timeout);
10597
}, [date]);
98+
10699
return <span suppressHydrationWarning>{currentTime}</span>;
107100
}
108101

@@ -872,7 +865,7 @@ function ExampleLayout({
872865
.filter((s) => s !== null);
873866
setOverlayStyles(nextOverlayStyles);
874867
}
875-
}, [activeArea]);
868+
}, [activeArea, hoverTopOffset]);
876869
return (
877870
<div className="lg:pl-10 lg:pr-5 w-full">
878871
<div className="mt-12 mb-2 lg:my-16 max-w-7xl mx-auto flex flex-col w-full lg:rounded-2xl lg:bg-card lg:dark:bg-card-dark">
@@ -1252,7 +1245,7 @@ function useNestedScrollLock(ref) {
12521245
window.removeEventListener('scroll', handleScroll);
12531246
clearInterval(interval);
12541247
};
1255-
}, []);
1248+
}, [ref]);
12561249
}
12571250

12581251
function ExamplePanel({
@@ -1261,7 +1254,6 @@ function ExamplePanel({
12611254
noShadow,
12621255
height,
12631256
contentMarginTop,
1264-
activeArea,
12651257
}) {
12661258
return (
12671259
<div

src/components/Layout/Sidebar/SidebarLink.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export function SidebarLink({
5454
ref={ref}
5555
title={title}
5656
target={target}
57+
passHref
5758
aria-current={selected ? 'page' : undefined}
5859
className={cn(
5960
'p-2 pr-2 w-full rounded-none lg:rounded-r-2xl text-left hover:bg-gray-5 dark:hover:bg-gray-80 relative flex items-center justify-between',

src/components/Layout/SidebarNav/SidebarNav.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import {Suspense} from 'react';
66
import * as React from 'react';
77
import cn from 'classnames';
8-
import {Search} from 'components/Search';
98
import {Feedback} from '../Feedback';
109
import {SidebarRouteTree} from '../Sidebar/SidebarRouteTree';
1110
import type {RouteItem} from '../getRouteMeta';

src/components/Layout/TopNav/TopNav.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ import {IconSearch} from 'components/Icon/IconSearch';
2222
import {Search} from 'components/Search';
2323
import {Logo} from '../../Logo';
2424
import {Feedback} from '../Feedback';
25-
import {SidebarRouteTree} from '../Sidebar/SidebarRouteTree';
25+
import {SidebarRouteTree} from '../Sidebar';
2626
import type {RouteItem} from '../getRouteMeta';
27-
import {SidebarLink} from '../Sidebar';
2827

2928
declare global {
3029
interface Window {

src/components/Layout/getRouteMeta.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function getRouteMeta(cleanedPath: string, routeTree: RouteItem) {
6868
currentIndex: 0,
6969
};
7070
buildRouteMeta(cleanedPath, routeTree, ctx);
71-
const {currentIndex, ...meta} = ctx;
71+
const {currentIndex: _, ...meta} = ctx;
7272
return {
7373
...meta,
7474
breadcrumbs: breadcrumbs.length > 0 ? breadcrumbs : [routeTree],

src/components/MDX/BlogCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function BlogCard({title, badge, date, icon, url, children}: BlogCardProps) {
1818
return (
1919
<Link
2020
href={url as string}
21+
passHref
2122
className="block h-full w-full rounded-2xl outline-none focus:outline-none focus-visible:outline focus-visible:outline-link focus:outline-offset-2 focus-visible:dark:focus:outline-link-dark">
2223
<div className="justify-between p-5 sm:p-5 cursor-pointer w-full h-full flex flex-col flex-1 shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10 rounded-2xl text-xl text-primary dark:text-primary-dark leading-relaxed">
2324
<div className="flex flex-row gap-3 w-full">

src/components/MDX/MDXComponents.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ function YouTubeIframe(props: any) {
369369
}
370370

371371
function Image(props: any) {
372-
return <img className="max-w-[calc(min(700px,100%))]" {...props} />;
372+
const {alt, ...rest} = props;
373+
return <img alt={alt} className="max-w-[calc(min(700px,100%))]" {...rest} />;
373374
}
374375

375376
export const MDXComponents = {

src/components/MDX/Sandpack/CustomPreset.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export const CustomPreset = memo(function CustomPreset({
5454

5555
const SandboxShell = memo(function SandboxShell({
5656
showDevTools,
57-
onDevToolsLoad,
5857
devToolsLoaded,
5958
providedFiles,
6059
lintErrors,

src/components/MDX/Sandpack/NavigationBar.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,17 @@ export function NavigationBar({providedFiles}: {providedFiles: Array<string>}) {
9090
} else {
9191
return;
9292
}
93-
}, [isMultiFile]);
93+
94+
// Note: in a real useEvent, onContainerResize would be omitted.
95+
}, [isMultiFile, onContainerResize]);
9496

9597
const handleReset = () => {
9698
/**
9799
* resetAllFiles must come first, otherwise
98-
* the previous content will appears for a second
100+
* the previous content will appear for a second
99101
* when the iframe loads.
100102
*
101-
* Plus, it should only prompts if there's any file changes
103+
* Plus, it should only prompt if there's any file changes
102104
*/
103105
if (
104106
sandpack.editorState === 'dirty' &&

src/components/MDX/Sandpack/Preview.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export function Preview({
4949
errorScreenRegisteredRef,
5050
openInCSBRegisteredRef,
5151
loadingScreenRegisteredRef,
52-
status,
5352
} = sandpack;
5453

5554
if (

src/components/MDX/TeamMember.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Image from 'next/image';
77
import {IconTwitter} from '../Icon/IconTwitter';
88
import {IconGitHub} from '../Icon/IconGitHub';
99
import {ExternalLink} from '../ExternalLink';
10-
import {IconNewPage} from 'components/Icon/IconNewPage';
1110
import {H3} from './Heading';
1211
import {IconLink} from 'components/Icon/IconLink';
1312

src/components/Search.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
import Head from 'next/head';
66
import Link from 'next/link';
77
import Router from 'next/router';
8-
import {lazy, useCallback, useEffect} from 'react';
8+
import {lazy, useEffect} from 'react';
99
import * as React from 'react';
1010
import {createPortal} from 'react-dom';
1111
import {siteConfig} from 'siteConfig';
12-
import cn from 'classnames';
1312

1413
export interface SearchProps {
1514
appId?: string;

src/content/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ June 15, 2022 by [Andrew Clark](https://twitter.com/acdlite), [Dan Abramov](http
2020

2121
## サーバコンポーネント {/*server-components*/}
2222

23-
2020 年 12 月に、[React サーバコンポーネント (RSC) に関する実験的なデモ](https://reactjs.org/blog/2020/12/21/data-fetching-with-react-server-components)を発表しました。それ以降、必要となる準備作業を React 18 で済ませ、実験のフィードバックから得られた改善に取り組んできました。
23+
2020 年 12 月に、[React サーバコンポーネント (RSC) に関する実験的なデモ](https://legacy.reactjs.org/blog/2020/12/21/data-fetching-with-react-server-components.html)を発表しました。それ以降、必要となる準備作業を React 18 で済ませ、実験のフィードバックから得られた改善に取り組んできました。
2424

2525
特に、I/O ライブラリをフォークして例えば react-fetch のようなものを作成していく、というアイディアは捨て去ることにし、代わりに互換性のために async/await モデルを採用することにします。データフェッチングにはルータを使うこともできるのでこれにより RSC のリリースが遅れるということはありません。もうひとつの変更は、ファイルの拡張子でサーバコンポーネントかどうかを区別するというアプローチをやめ、[区別を注釈で行う](https://github.com/reactjs/rfcs/pull/189#issuecomment-1116482278)ことにする、というものです。
2626

src/content/community/conferences.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,6 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1010

1111
## Upcoming Conferences {/*upcoming-conferences*/}
1212

13-
### React Norway 2023 {/*react-norway-2023*/}
14-
June 16th, 2023. Larvik, Norway
15-
16-
[Website](https://reactnorway.com/) - [Twitter](https://twitter.com/ReactNorway/) - [Facebook](https://www.facebook.com/reactdaynorway/)
17-
18-
### ReactNext 2023 {/*reactnext-2023*/}
19-
June 27th, 2023. Tel Aviv, Israel
20-
21-
[Website](https://www.react-next.com/) - [Facebook](https://www.facebook.com/ReactNextConf) - [Youtube](https://www.youtube.com/@ReactNext)
22-
23-
### React Nexus 2023 {/*react-nexus-2023*/}
24-
July 07 & 08, 2023. Bangalore, India (In-person event)
25-
26-
[Website](https://reactnexus.com/) - [Twitter](https://twitter.com/ReactNexus) - [Linkedin](https://www.linkedin.com/company/react-nexus) - [YouTube](https://www.youtube.com/reactify_in)
27-
2813
### React Rally 2023 🐙 {/*react-rally-2023*/}
2914
August 17 & 18, 2023. Salt Lake City, UT, USA
3015

@@ -52,6 +37,21 @@ December 8 & 12, 2023. In-person in Berlin, Germany + remote first interactivity
5237

5338
## Past Conferences {/*past-conferences*/}
5439

40+
### React Nexus 2023 {/*react-nexus-2023*/}
41+
July 07 & 08, 2023. Bangalore, India (In-person event)
42+
43+
[Website](https://reactnexus.com/) - [Twitter](https://twitter.com/ReactNexus) - [Linkedin](https://www.linkedin.com/company/react-nexus) - [YouTube](https://www.youtube.com/reactify_in)
44+
45+
### ReactNext 2023 {/*reactnext-2023*/}
46+
June 27th, 2023. Tel Aviv, Israel
47+
48+
[Website](https://www.react-next.com/) - [Facebook](https://www.facebook.com/ReactNextConf) - [Youtube](https://www.youtube.com/@ReactNext)
49+
50+
### React Norway 2023 {/*react-norway-2023*/}
51+
June 16th, 2023. Larvik, Norway
52+
53+
[Website](https://reactnorway.com/) - [Twitter](https://twitter.com/ReactNorway/) - [Facebook](https://www.facebook.com/reactdaynorway/)
54+
5555
### React Summit 2023 {/*react-summit-2023*/}
5656
June 2 & 6, 2023. In-person in Amsterdam, Netherlands + remote first interactivity (hybrid event)
5757

@@ -510,7 +510,7 @@ August 18 in Guangzhou, China
510510

511511
[Website](https://react.w3ctech.com)
512512

513-
### React Rally 2018{/*react-rally-2018*/}
513+
### React Rally 2018 {/*react-rally-2018*/}
514514
August 16-17 in Salt Lake City, Utah USA
515515

516516
[Website](http://www.reactrally.com) - [Twitter](https://twitter.com/reactrally)

0 commit comments

Comments
 (0)