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/blog/2025/04/21/react-compiler-rc.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,23 +57,23 @@ During the RC period, we encourage all React users to try the compiler and provi
57
57
As noted in the Beta announcement, React Compiler is compatible with React 17 and up. If you are not yet on React 19, you can use React Compiler by specifying a minimum target in your compiler config, and adding `react-compiler-runtime` as a dependency. You can find docs on this [here](https://react.dev/learn/react-compiler#using-react-compiler-with-react-17-or-18).
58
58
59
59
## Migrating from eslint-plugin-react-compiler to eslint-plugin-react-hooks {/*migrating-from-eslint-plugin-react-compiler-to-eslint-plugin-react-hooks*/}
60
-
If you have already installed eslint-plugin-react-compiler, you can now remove it and use `eslint-plugin-react-hooks@6.0.0-rc.1`. Many thanks to [@michaelfaith](https://bsky.app/profile/michael.faith) for contributing to this improvement!
60
+
If you have already installed eslint-plugin-react-compiler, you can now remove it and use `eslint-plugin-react-hooks@rc`. Many thanks to [@michaelfaith](https://bsky.app/profile/michael.faith) for contributing to this improvement!
Copy file name to clipboardExpand all lines: src/content/learn/react-compiler/installation.md
+1-10Lines changed: 1 addition & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,16 +176,7 @@ Install the ESLint plugin:
176
176
npm install -D eslint-plugin-react-hooks@rc
177
177
</TerminalBlock>
178
178
179
-
Then enable the compiler rule in your ESLint configuration:
180
-
181
-
```js {3}
182
-
// .eslintrc.js
183
-
module.exports= {
184
-
rules: {
185
-
'react-hooks/react-compiler':'error',
186
-
},
187
-
};
188
-
```
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.
189
180
190
181
The ESLint rule will:
191
182
- Identify violations of the [Rules of React](/reference/rules)
Copy file name to clipboardExpand all lines: src/content/learn/react-compiler/introduction.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,7 +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
-
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.
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.
158
158
159
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-dom/components/index.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,31 +162,31 @@ React সকল বিল্ট-ইন ব্রাউজার HTML কম্
162
162
163
163
### কাস্টম HTML এলিমেন্ট {/*custom-html-elements*/}
164
164
165
-
আপনি যদি dash আছে এমন একটি ট্যাগ রেন্ডার করেন, like`<my-element>`, React ধরে নেবে যে আপনি একটি [কাস্টম HTML এলিমেন্ট](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) রেন্ডার করতে চান। React এর ক্ষেত্রে, কাস্টম এলিমেন্ট রেন্ডার করা এবং বিল্ট-ইন ব্রাউজার ট্যাগ রেন্ডার করা ভিন্ন ভাবে কাজ করে।
165
+
আপনি যদি dash সহ একটি ট্যাগ রেন্ডার করেন, যেমন`<my-element>`, React ধরবে আপনি একটি [custom HTML element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) রেন্ডার করতে চাইছেন।
166
166
167
167
আপনি যদি [`is`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/is) এট্রিবিউট সহ একটি ব্রাউজার বিল্ট-ইন HTML এলিমেন্ট রেন্ডার করেন, তবে এটিকে একটি কাস্টম এলিমেন্ট হিসাবে গণ্য করা হবে।
168
168
169
-
#### Setting values on custom elements {/*attributes-vs-properties*/}
169
+
#### কাস্টম এলিমেন্টে ভ্যালু সেট করা {/*attributes-vs-properties*/}
170
170
171
-
Custom elements have two methods of passing data into them:
171
+
কাস্টম এলিমেন্টে ডেটা পাঠানোর দুটি উপায় আছে:
172
172
173
-
1) Attributes: Which are displayed in markup and can only be set to string values
174
-
2) Properties: Which are not displayed in markup and can be set to arbitrary JavaScript values
173
+
1) Attributes: যেগুলো markup-এ দেখা যায় এবং কেবল string মানেই সেট করা যায়
174
+
2) Properties: যেগুলো markup-এ দেখা যায় না এবং যেকোনো JavaScript মানে সেট করা যায়
175
175
176
-
By default, React will pass values bound in JSX as attributes:
176
+
ডিফল্টভাবে, React JSX-এ bind করা মানগুলোকে attributes হিসেবে পাঠায়:
177
177
178
178
```jsx
179
179
<my-element value="Hello, world!"></my-element>
180
180
```
181
181
182
-
Non-string JavaScript values passed to custom elements will be serialized by default:
182
+
স্ট্রিং নয় এমন জাভাস্ক্রিপ্ট ভ্যালু কাস্টম এলিমেন্টসে পাঠালে ডিফল্টভাবে সেগুলো সিরিয়ালাইজ করা হবে:
183
183
184
184
```jsx
185
185
// Will be passed as `"1,2,3"` as the output of `[1,2,3].toString()`
186
186
<my-element value={[1,2,3]}></my-element>
187
187
```
188
188
189
-
React will, however, recognize an custom element's property as one that it may pass arbitrary values to if the property name shows up on the class during construction:
189
+
তবে, কোনো কাস্টম এলিমেন্টের ক্লাস কন্সট্রাকশন চলাকালে যদি কোনো প্রপার্টির নাম দৃশ্যমান থাকে, React সেটিকে প্রপার্টি হিসেবে চিনে নিয়ে সেখানে arbitrary মান পাঠাতে পারে:
190
190
191
191
<Sandpack>
192
192
@@ -224,9 +224,9 @@ export function App() {
224
224
225
225
</Sandpack>
226
226
227
-
#### Listening for events on custom elements {/*custom-element-events*/}
A common pattern when using custom elements is that they may dispatch [`CustomEvent`s](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)rather than accept a function to call when an event occur. You can listen for these events using an `on`prefix when binding to the event via JSX.
229
+
কাস্টম এলিমেন্ট ব্যবহার করার সময় একটি সাধারণ প্যাটার্ন হলো—এগুলো কোন ইভেন্ট হলে কল করার জন্য ফাংশন নেয়ার বদলে [`CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)dispatch করতে পারে। JSX-এর মাধ্যমে bind করার সময় ইভেন্ট নামের আগে `on`প্রিফিক্স দিয়ে এগুলোর ইভেন্ট শোনা যাবে।
230
230
231
231
<Sandpack>
232
232
@@ -285,7 +285,7 @@ export function App() {
285
285
286
286
<Note>
287
287
288
-
Events are case-sensitive and support dashes (`-`). Preserve the casing of the event and include all dashes when listening for custom element's events:
288
+
ইভেন্টগুলোর ক্ষেত্রে casing সংবেদনশীল এবং dashes (`-`) সাপোর্ট করে। custom element-এর ইভেন্ট শোনার সময় ইভেন্টের casing ঠিক রাখুন এবং সব dashes অন্তর্ভুক্ত করুন:
0 commit comments