You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/learn/add-react-to-an-existing-project.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,11 +24,7 @@ title: اضافه کردن ریاکت به یک پروژه موجود
24
24
2.**`/some-app` را بهعنوان *مسیر پایه*** در پیکربندی فریمورک خود مشخص کنید (راهنما: [Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath)، [Gatsby](https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/path-prefix/)).
25
25
3.**سرور یا پروکسی خود را پیکربندی کنید** تا همه درخواستهای زیر مسیر `/some-app/` توسط اپلیکیشن ریاکت شما مدیریت شوند.
26
26
27
-
<<<<<<< HEAD
28
-
این کار تضمین میکند که بخش ریاکت اپلیکیشن شما میتواند از [بهترین شیوههای موجود](/learn/build-a-react-app-from-scratch#consider-using-a-framework) که در این فریمورکها تعبیه شدهاند بهرهمند شود.
29
-
=======
30
-
This ensures the React part of your app can [benefit from the best practices](/learn/build-a-react-app-from-scratch#consider-using-a-framework) baked into those frameworks.
31
-
>>>>>>> 2774ddfa0c39b8c2f0563b987dcb90a01ee723cf
27
+
این کار تضمین میکند که بخش ریاکت اپلیکیشن شما میتواند از [بهترین شیوههای موجود](/learn/build-a-react-app-from-scratch#consider-using-a-framework) که در این فریمورکها تعبیه شدهاند بهرهمند شود.
32
28
33
29
بسیاری از فریمورکهای مبتنی بر ریاکت فولاستک هستند و به اپلیکیشن ریاکت شما اجازه میدهند از قابلیتهای سرور استفاده کند. با این حال، حتی اگر نتوانید یا نخواهید جاوااسکریپت را روی سرور اجرا کنید، میتوانید از همان رویکرد استفاده کنید. در این حالت، خروجی HTML/CSS/JS را (خروجی [`next export`](https://nextjs.org/docs/advanced-features/static-html-export) در Next.js یا حالت پیشفرض در Gatsby) در مسیر `/some-app/` سرو کنید.
Copy file name to clipboardExpand all lines: src/content/learn/react-compiler/installation.md
-13Lines changed: 0 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,20 +176,7 @@ Install the ESLint plugin:
176
176
npm install -D eslint-plugin-react-hooks@rc
177
177
</TerminalBlock>
178
178
179
-
<<<<<<< HEAD
180
-
Then enable the compiler rule in your ESLint configuration:
181
-
182
-
```js {3}
183
-
// .eslintrc.js
184
-
module.exports= {
185
-
rules: {
186
-
'react-hooks/react-compiler':'error',
187
-
},
188
-
};
189
-
```
190
-
=======
191
179
If you haven't already configured eslint-plugin-react-hooks, follow the [installation instructions in the readme](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md#installation). The compiler rule is enabled by default in the latest RC, so no additional configuration is needed.
192
-
>>>>>>> 2774ddfa0c39b8c2f0563b987dcb90a01ee723cf
193
180
194
181
The ESLint rule will:
195
182
- Identify violations of the [Rules of React](/reference/rules)
Copy file name to clipboardExpand all lines: src/content/learn/react-compiler/introduction.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,11 +154,7 @@ Next.js users can enable the swc-invoked React Compiler by using [v15.3.1](https
154
154
155
155
## What should I do about useMemo, useCallback, and React.memo? {/*what-should-i-do-about-usememo-usecallback-and-reactmemo*/}
156
156
157
-
<<<<<<< HEAD
158
-
If you are using React Compiler, [`useMemo`](/reference/react/useMemo), [`useCallback`](/reference/react/useCallback), and [`React.memo`](/reference/react/memo) can be removed. React Compiler adds automatic memoization more precisely and granularly than is possible with these hooks. If you choose to keep manual memoization, React Compiler will analyze them and determine if your manual memoization matches its automatically inferred memoization. If there isn't a match, the compiler will choose to bail out of optimizing that component.
159
-
=======
160
157
React Compiler adds automatic memoization more precisely and granularly than is possible with [`useMemo`](/reference/react/useMemo), [`useCallback`](/reference/react/useCallback), and [`React.memo`](/reference/react/memo). If you choose to keep manual memoization, React Compiler will analyze them and determine if your manual memoization matches its automatically inferred memoization. If there isn't a match, the compiler will choose to bail out of optimizing that component.
161
-
>>>>>>> 2774ddfa0c39b8c2f0563b987dcb90a01ee723cf
162
158
163
159
This is done out of caution as a common anti-pattern with manual memoization is using it for correctness. This means your app depends on specific values being memoized to work properly. For example, in order to prevent an infinite loop, you may have memoized some values to stop a `useEffect` call from firing. This breaks the Rules of React, but since it can potentially be dangerous for the compiler to automatically remove manual memoization, the compiler will just bail out instead. You should manually remove your handwritten memoization and verify that your app still works as expected.
Copy file name to clipboardExpand all lines: src/content/reference/react/Activity.md
-19Lines changed: 0 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,11 +51,7 @@ While hidden, children still re-render in response to new props, albeit at a low
51
51
52
52
When the boundary becomes <CodeStepstep={3}>visible</CodeStep> again, React will reveal the children with their previous state restored, and re-create their Effects.
53
53
54
-
<<<<<<< HEAD
55
-
In this way, Activity can thought of as a mechanism for rendering "background activity". Rather than completely discarding content that's likely to become visible again, you can use Activity to maintain and restore that content's UI and internal state, while ensuring hidden content has no unwanted side effects.
56
-
=======
57
54
In this way, Activity can be thought of as a mechanism for rendering "background activity". Rather than completely discarding content that's likely to become visible again, you can use Activity to maintain and restore that content's UI and internal state, while ensuring that your hidden content has no unwanted side effects.
58
-
>>>>>>> 2774ddfa0c39b8c2f0563b987dcb90a01ee723cf
59
55
60
56
[See more examples below.](#usage)
61
57
@@ -66,23 +62,15 @@ In this way, Activity can be thought of as a mechanism for rendering "background
66
62
67
63
#### Caveats {/*caveats*/}
68
64
69
-
<<<<<<< HEAD
70
-
- When used with `<ViewTransition>`, hidden activities that reveal in a transition will activate an "enter" animation. Visible Activities hidden in a transition will activate an "exit" animation.
71
-
=======
72
65
- If an Activity is rendered inside of a [ViewTransition](/reference/react/ViewTransition), and it becomes visible as a result of an update caused by [startTransition](/reference/react/startTransition), it will activate the ViewTransition's `enter` animation. If it becomes hidden, it will activate its `exit` animation.
73
-
>>>>>>> 2774ddfa0c39b8c2f0563b987dcb90a01ee723cf
74
66
75
67
---
76
68
77
69
## Usage {/*usage*/}
78
70
79
71
### Restoring the state of hidden components {/*restoring-the-state-of-hidden-components*/}
80
72
81
-
<<<<<<< HEAD
82
-
Typically in React, when you want to conditionally show or hide a component, you mount and unmount it:
83
-
=======
84
73
In React, when you want to conditionally show or hide a component, you typically mount or unmount it based on that condition:
85
-
>>>>>>> 2774ddfa0c39b8c2f0563b987dcb90a01ee723cf
86
74
87
75
```jsx
88
76
{isShowingSidebar && (
@@ -100,19 +88,12 @@ When you hide a component using an Activity boundary instead, React will "save"
100
88
</Activity>
101
89
```
102
90
103
-
<<<<<<< HEAD
104
-
This makes it possible to restore components to their previous state.
105
91
106
-
The following example has a sidebar with an expandable section – you can press "Overview" to reveal the three subitems below it. The main app area also has a button that hides and shows the sidebar.
107
-
108
-
Try expanding the Overview section, then toggling the sidebar closed and open:
109
-
=======
110
92
This makes it possible to hide and then later restore components in the state they were previously in.
111
93
112
94
The following example has a sidebar with an expandable section. You can press "Overview" to reveal the three subitems below it. The main app area also has a button that hides and shows the sidebar.
113
95
114
96
Try expanding the Overview section, and then toggling the sidebar closed then open:
0 commit comments