Skip to content

Commit c7db123

Browse files
authored
Merge pull request #652 from reactjs/sync-49c2d267
Sync with react.dev @ 49c2d26
2 parents 89ea698 + 391321d commit c7db123

34 files changed

+433
-149
lines changed

src/components/Layout/Sidebar/SidebarLink.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface SidebarLinkProps {
2424
selected?: boolean;
2525
title: string;
2626
level: number;
27-
version?: 'canary' | 'major' | 'experimental';
27+
version?: 'canary' | 'major' | 'experimental' | 'rc';
2828
icon?: React.ReactNode;
2929
isExpanded?: boolean;
3030
hideArrow?: boolean;
@@ -102,6 +102,12 @@ export function SidebarLink({
102102
className="ms-1 text-gray-30 dark:text-gray-60 inline-block w-3.5 h-3.5 align-[-3px]"
103103
/>
104104
)}
105+
{version === 'rc' && (
106+
<IconCanary
107+
title=" - This feature is available in the latest RC version"
108+
className="ms-1 text-gray-30 dark:text-gray-60 inline-block w-3.5 h-3.5 align-[-3px]"
109+
/>
110+
)}
105111
</div>
106112

107113
{isExpanded != null && !hideArrow && (

src/components/MDX/ExpandableCallout.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type CalloutVariants =
2424
| 'wip'
2525
| 'canary'
2626
| 'experimental'
27+
| 'rc'
2728
| 'major'
2829
| 'rsc';
2930

@@ -50,6 +51,15 @@ const variantMap = {
5051
overlayGradient:
5152
'linear-gradient(rgba(245, 249, 248, 0), rgba(245, 249, 248, 1)',
5253
},
54+
rc: {
55+
title: 'RC',
56+
Icon: IconCanary,
57+
containerClasses:
58+
'bg-gray-5 dark:bg-gray-60 dark:bg-opacity-20 text-primary dark:text-primary-dark text-lg',
59+
textColor: 'text-gray-60 dark:text-gray-30',
60+
overlayGradient:
61+
'linear-gradient(rgba(245, 249, 248, 0), rgba(245, 249, 248, 1)',
62+
},
5363
canary: {
5464
title: 'Test Ortamı (Canary)',
5565
Icon: IconCanary,

src/components/MDX/MDXComponents.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ const Canary = ({children}: {children: React.ReactNode}) => (
106106
<ExpandableCallout type="canary">{children}</ExpandableCallout>
107107
);
108108

109+
const RC = ({children}: {children: React.ReactNode}) => (
110+
<ExpandableCallout type="rc">{children}</ExpandableCallout>
111+
);
112+
109113
const Experimental = ({children}: {children: React.ReactNode}) => (
110114
<ExpandableCallout type="experimental">{children}</ExpandableCallout>
111115
);
@@ -533,6 +537,7 @@ export const MDXComponents = {
533537
Math,
534538
MathI,
535539
Note,
540+
RC,
536541
Canary,
537542
Experimental,
538543
ExperimentalBadge,

src/components/PageHeading.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {IconExperimental} from './Icon/IconExperimental';
1919

2020
interface PageHeadingProps {
2121
title: string;
22-
version?: 'experimental' | 'canary';
22+
version?: 'experimental' | 'canary' | 'rc';
2323
experimental?: boolean;
2424
status?: string;
2525
description?: string;
@@ -46,6 +46,12 @@ function PageHeading({
4646
className="ms-4 mt-1 text-gray-50 dark:text-gray-40 inline-block w-6 h-6 align-[-1px]"
4747
/>
4848
)}
49+
{version === 'rc' && (
50+
<IconCanary
51+
title=" - This feature is available in the latest RC version"
52+
className="ms-4 mt-1 text-gray-50 dark:text-gray-40 inline-block w-6 h-6 align-[-1px]"
53+
/>
54+
)}
4955
{version === 'experimental' && (
5056
<IconExperimental
5157
title=" - This feature is available in the latest Experimental version of React"

src/content/blog/2025/04/23/react-labs-view-transitions-activity-and-more.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14303,7 +14303,7 @@ useEffect(() => {
1430314303
}); // compiler inserted dependencies.
1430414304
```
1430514305

14306-
With this code, the React Compiler can infer the dependencies for you and insert them automatically so you don't need to see or write them. With features like [the IDE extension](#compiler-ide-extension) and [`useEffectEvent`](/reference/react/experimental_useEffectEvent), we can provide a CodeLens to show you what the Compiler inserted for times you need to debug, or to optimize by removing a dependency. This helps reinforce the correct mental model for writing Effects, which can run at any time to synchronize your component or hook's state with something else.
14306+
With this code, the React Compiler can infer the dependencies for you and insert them automatically so you don't need to see or write them. With features like [the IDE extension](#compiler-ide-extension) and [`useEffectEvent`](/reference/react/useEffectEvent), we can provide a CodeLens to show you what the Compiler inserted for times you need to debug, or to optimize by removing a dependency. This helps reinforce the correct mental model for writing Effects, which can run at any time to synchronize your component or hook's state with something else.
1430714307

1430814308
Our hope is that automatically inserting dependencies is not only easier to write, but that it also makes them easier to understand by forcing you to think in terms of what the Effect does, and not in component lifecycles.
1430914309

src/content/learn/escape-hatches.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,8 @@ Bu ideal değildir. Sohbete yalnızca `roomId` değiştiğinde tekrar bağlanmak
455455
```json package.json hidden
456456
{
457457
"dependencies": {
458-
"react": "experimental",
459-
"react-dom": "experimental",
458+
"react": "canary",
459+
"react-dom": "canary",
460460
"react-scripts": "latest",
461461
"toastify-js": "1.12.0"
462462
},
@@ -471,7 +471,7 @@ Bu ideal değildir. Sohbete yalnızca `roomId` değiştiğinde tekrar bağlanmak
471471

472472
```js
473473
import { useState, useEffect } from 'react';
474-
import { experimental_useEffectEvent as useEffectEvent } from 'react';
474+
import { useEffectEvent } from 'react';
475475
import { createConnection, sendMessage } from './chat.js';
476476
import { showNotification } from './notifications.js';
477477

src/content/learn/removing-effect-dependencies.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -610,11 +610,13 @@ function ChatRoom({ roomId }) {
610610
611611
### Bir değeri, değişikliklerine "tepki vermeden" okumak mı istiyorsunuz? {/*do-you-want-to-read-a-value-without-reacting-to-its-changes*/}
612612
613-
<Wip>
613+
<Canary>
614614
615-
Bu bölümde, React'in kararlı bir sürümünde henüz yayınlanmamış **deneysel bir API** açıklanmaktadır.
615+
**`useEffectEvent` API’si şu anda yalnızca React’in Canary ve Experimental kanallarında kullanılabilir.**
616616
617-
</Wip>
617+
[Learn more about React’s release channels here.](/community/versioning-policy#all-release-channels)
618+
619+
</Canary>
618620
619621
Kullanıcı yeni bir mesaj aldığında `isMuted` değeri `true` olmadığı sürece bir ses çalmak istediğinizi varsayalım:
620622
@@ -1262,8 +1264,8 @@ Efektin içinde reaktif olmaması gereken bir kod satırı var mı? Reaktif olma
12621264
```json package.json hidden
12631265
{
12641266
"dependencies": {
1265-
"react": "experimental",
1266-
"react-dom": "experimental",
1267+
"react": "canary",
1268+
"react-dom": "canary",
12671269
"react-scripts": "latest"
12681270
},
12691271
"scripts": {
@@ -1277,7 +1279,7 @@ Efektin içinde reaktif olmaması gereken bir kod satırı var mı? Reaktif olma
12771279
12781280
```js
12791281
import { useState, useEffect, useRef } from 'react';
1280-
import { experimental_useEffectEvent as useEffectEvent } from 'react';
1282+
import { useEffectEvent } from 'react';
12811283
import { FadeInAnimation } from './animation.js';
12821284

12831285
function Welcome({ duration }) {
@@ -1389,8 +1391,8 @@ Efektinizin `duration` ın en son değerini okuması gerekir, ancak `duration`da
13891391
```json package.json hidden
13901392
{
13911393
"dependencies": {
1392-
"react": "experimental",
1393-
"react-dom": "experimental",
1394+
"react": "canary",
1395+
"react-dom": "canary",
13941396
"react-scripts": "latest"
13951397
},
13961398
"scripts": {
@@ -1405,7 +1407,7 @@ Efektinizin `duration` ın en son değerini okuması gerekir, ancak `duration`da
14051407
```js
14061408
import { useState, useEffect, useRef } from 'react';
14071409
import { FadeInAnimation } from './animation.js';
1408-
import { experimental_useEffectEvent as useEffectEvent } from 'react';
1410+
import { useEffectEvent } from 'react';
14091411

14101412
function Welcome({ duration }) {
14111413
const ref = useRef(null);
@@ -1825,8 +1827,8 @@ Bu fonksiyonlardan bir diğeri yalnızca içe aktarılan bir API yöntemine baz
18251827
```json package.json hidden
18261828
{
18271829
"dependencies": {
1828-
"react": "experimental",
1829-
"react-dom": "experimental",
1830+
"react": "canary",
1831+
"react-dom": "canary",
18301832
"react-scripts": "latest",
18311833
"toastify-js": "1.12.0"
18321834
},
@@ -1907,7 +1909,7 @@ export default function App() {
19071909

19081910
```js src/ChatRoom.js active
19091911
import { useState, useEffect } from 'react';
1910-
import { experimental_useEffectEvent as useEffectEvent } from 'react';
1912+
import { useEffectEvent } from 'react';
19111913
19121914
export default function ChatRoom({ roomId, createConnection, onMessage }) {
19131915
useEffect(() => {
@@ -2120,8 +2122,8 @@ Sonuç olarak, sohbet yalnızca anlamlı bir şey (`roomId` veya `isEncrypted`)
21202122
```json package.json hidden
21212123
{
21222124
"dependencies": {
2123-
"react": "experimental",
2124-
"react-dom": "experimental",
2125+
"react": "canary",
2126+
"react-dom": "canary",
21252127
"react-scripts": "latest",
21262128
"toastify-js": "1.12.0"
21272129
},
@@ -2189,7 +2191,7 @@ export default function App() {
21892191
21902192
```js src/ChatRoom.js active
21912193
import { useState, useEffect } from 'react';
2192-
import { experimental_useEffectEvent as useEffectEvent } from 'react';
2194+
import { useEffectEvent } from 'react';
21932195
import {
21942196
createEncryptedConnection,
21952197
createUnencryptedConnection,

src/content/learn/reusing-logic-with-custom-hooks.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -837,11 +837,13 @@ export default function ChatRoom({ roomId }) {
837837
838838
### Olay yöneticilerini özel Hook'lara geçirme {/*passing-event-handlers-to-custom-hooks*/}
839839
840-
<Wip>
840+
<Canary>
841841
842-
Bu bölüm **henüz kararlı bir sürümde yayınlanmamış olan deneysel bir API'yi** açıklar.
842+
**`useEffectEvent` API'si şu anda yalnızca React'in Canary ve Experimental kanallarında mevcuttur.**
843843
844-
</Wip>
844+
[Learn more about React’s release channels here.](/community/versioning-policy#all-release-channels)
845+
846+
</Canary>
845847
846848
`useChatRoom`'u daha fazla bileşende kullanmaya başladıkça, bileşenlerin onun davranışını özelleştirmesine izin vermek isteyebilirsiniz. Örneğin, şu anda, bir mesaj geldiğinde ne yapılacağının mantığı Hook'un içine sabit kodlanmış durumda:
847849
@@ -985,7 +987,7 @@ export default function ChatRoom({ roomId }) {
985987
986988
```js src/useChatRoom.js
987989
import { useEffect } from 'react';
988-
import { experimental_useEffectEvent as useEffectEvent } from 'react';
990+
import { useEffectEvent } from 'react';
989991
import { createConnection } from './chat.js';
990992
991993
export function useChatRoom({ serverUrl, roomId, onReceiveMessage }) {
@@ -1070,8 +1072,8 @@ export function showNotification(message, theme = 'dark') {
10701072
```json package.json hidden
10711073
{
10721074
"dependencies": {
1073-
"react": "experimental",
1074-
"react-dom": "experimental",
1075+
"react": "canary",
1076+
"react-dom": "canary",
10751077
"react-scripts": "latest",
10761078
"toastify-js": "1.12.0"
10771079
},
@@ -1668,7 +1670,7 @@ export default function App() {
16681670
16691671
```js src/useFadeIn.js active
16701672
import { useState, useEffect } from 'react';
1671-
import { experimental_useEffectEvent as useEffectEvent } from 'react';
1673+
import { useEffectEvent } from 'react';
16721674
16731675
export function useFadeIn(ref, duration) {
16741676
const [isRunning, setIsRunning] = useState(true);
@@ -1721,8 +1723,8 @@ html, body { min-height: 300px; }
17211723
```json package.json hidden
17221724
{
17231725
"dependencies": {
1724-
"react": "experimental",
1725-
"react-dom": "experimental",
1726+
"react": "canary",
1727+
"react-dom": "canary",
17261728
"react-scripts": "latest"
17271729
},
17281730
"scripts": {
@@ -2216,8 +2218,8 @@ Görünen o ki `useInterval` Hook'unuz argüman olarak bir olay dinleyicisi alı
22162218
```json package.json hidden
22172219
{
22182220
"dependencies": {
2219-
"react": "experimental",
2220-
"react-dom": "experimental",
2221+
"react": "canary",
2222+
"react-dom": "canary",
22212223
"react-scripts": "latest"
22222224
},
22232225
"scripts": {
@@ -2260,7 +2262,7 @@ export function useCounter(delay) {
22602262
22612263
```js src/useInterval.js
22622264
import { useEffect } from 'react';
2263-
import { experimental_useEffectEvent as useEffectEvent } from 'react';
2265+
import { useEffectEvent } from 'react';
22642266

22652267
export function useInterval(onTick, delay) {
22662268
useEffect(() => {
@@ -2287,8 +2289,8 @@ Bu değişiklikle birlikte, her iki interval de beklediğiniz gibi çalışır v
22872289
```json package.json hidden
22882290
{
22892291
"dependencies": {
2290-
"react": "experimental",
2291-
"react-dom": "experimental",
2292+
"react": "canary",
2293+
"react-dom": "canary",
22922294
"react-scripts": "latest"
22932295
},
22942296
"scripts": {
@@ -2332,7 +2334,7 @@ export function useCounter(delay) {
23322334
23332335
```js src/useInterval.js active
23342336
import { useEffect } from 'react';
2335-
import { experimental_useEffectEvent as useEffectEvent } from 'react';
2337+
import { useEffectEvent } from 'react';
23362338

23372339
export function useInterval(callback, delay) {
23382340
const onTick = useEffectEvent(callback);

0 commit comments

Comments
 (0)